Implemented cert payload constructor for custom encoding types
This commit is contained in:
@@ -343,3 +343,15 @@ cert_payload_t *cert_payload_create_from_hash_and_url(chunk_t hash, char *url)
|
|||||||
return &this->public;
|
return &this->public;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Described in header
|
||||||
|
*/
|
||||||
|
cert_payload_t *cert_payload_create_custom(cert_encoding_t type, chunk_t data)
|
||||||
|
{
|
||||||
|
private_cert_payload_t *this = (private_cert_payload_t*)cert_payload_create();
|
||||||
|
|
||||||
|
this->encoding = type;
|
||||||
|
this->data = data;
|
||||||
|
this->payload_length = CERT_PAYLOAD_HEADER_LENGTH + this->data.len;
|
||||||
|
return &this->public;
|
||||||
|
}
|
||||||
|
|||||||
@@ -134,4 +134,13 @@ cert_payload_t *cert_payload_create_from_cert(certificate_t *cert);
|
|||||||
*/
|
*/
|
||||||
cert_payload_t *cert_payload_create_from_hash_and_url(chunk_t hash, char *url);
|
cert_payload_t *cert_payload_create_from_hash_and_url(chunk_t hash, char *url);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a custom certificate payload using type and associated data.
|
||||||
|
*
|
||||||
|
* @param type encoding type of certificate
|
||||||
|
* @param url associated data (gets owned)
|
||||||
|
* @return cert_payload_t object
|
||||||
|
*/
|
||||||
|
cert_payload_t *cert_payload_create_custom(cert_encoding_t type, chunk_t data);
|
||||||
|
|
||||||
#endif /** CERT_PAYLOAD_H_ @}*/
|
#endif /** CERT_PAYLOAD_H_ @}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user