Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement various DEREncoding methods #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathanverner
Copy link
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