Skip to content

Implement various DEREncoding methods#22

Open
jonathanverner wants to merge 1 commit into
noloader:masterfrom
jonathanverner:implement_some_x509cert_der_encode_methods
Open

Implement various DEREncoding methods#22
jonathanverner wants to merge 1 commit into
noloader:masterfrom
jonathanverner:implement_some_x509cert_der_encode_methods

Conversation

@jonathanverner
Copy link
Copy Markdown
Contributor

This commit provides implementation for the following DEREncode methods:

RdnValue::DEREncode
DateValue::DEREncode
ExtensionValue::DEREncode
KeyIdentifierValue::DEREncode
BasicConstraintValue::BERDecode

Notably, it does not implement the

X509Certificate::DEREncode

method, which is the main missing part for being able to go back-and-forth between a CryptoPP cert
and its DER-encoding.

The commit is still useful, e.g., for returning certificate attributes in a PKCS#11 which are supposed to
be DER-encoded, e.g. to return a CKA_START_DATE of a certificate, one can just write:

X509Certificate cert = ...;
std::vector<unsigned char> start_date;
VectorSource der_sink(start_date, true);
cert->GetNotBefore().DEREncode(der_sink);

This commit provides implementation for the following
DEREncode methods:

    RdnValue::DEREncode
    DateValue::DEREncode
    ExtensionValue::DEREncode
    KeyIdentifierValue::DEREncode
    BasicConstraintValue::BERDecode

Notably, it does not implement the

    X509Certificate::DEREncode

method, which is the main missing part for being
able to go back-and-forth between a CryptoPP cert
and its DER-encoding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant