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

Add CA and ADCS Template metadata to Pkcs12 #183

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

Conversation

cdelafuente-r7
Copy link

This adds the following metadata to Pkcs12:

  • CA: the certificate authority that issued the certificate.
  • ADCS Template: the AD CS certificate template used to issue the certificate.

The data is now serialized in the Pkcs12's data field with the following format: msf_pkcs12:<base64 cert>:<ca>:<ADCS template>.

This is a draft until we've wired up the corresponding UI changes in Pro to support consuming this metadata.

Also, this would require additional migration logic to support going from the old format to the new format, otherwise folk that have existing pkcs12 certs in their database might run into problems - but we can cross that bridge once things are wired up into Pro.

#
# @return [String]
def pkcs12
parsed_data[:pkcs12]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we want something to de-base64 encode and then load the DER data into a certificate object we can use?

If that doesn't fit here because this is for presentation, then maybe at least adding another method to handle that conversion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the #openssl_pkcs12 method below does something similar. It returns a OpenSSL::PKCS12 object, from which we can extract the certificate.

So we have #pkcs12 returning the based-64 encoded Pkcs12 and #openssl_pkcs12 returning a OpenSSL::PKCS12 object.

I'm also happy to change this logic if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants