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

Support importing and finding certificates #20

Closed
bernard-wagner opened this issue Jan 14, 2019 · 2 comments
Closed

Support importing and finding certificates #20

bernard-wagner opened this issue Jan 14, 2019 · 2 comments

Comments

@bernard-wagner
Copy link
Contributor

Current it is not possible to load certificates as x509.Certificates from an HSM. It would be beneficial to be able to import and find certificates for supported PKCS11 devices.

CK_OBJECT_CLASS class = CKO_CERTIFICATE;
CK_CERTIFICATE_TYPE certType = CKC_X_509;
CK_UTF8CHAR label[] = “A certificate object”;
CK_BYTE subject[] = {...};
CK_BYTE id[] = {123};
CK_BYTE certificate[] = {...};
CK_BBOOL true = CK_TRUE;
CK_ATTRIBUTE template[] = {
  {CKA_CLASS, &class, sizeof(class)},
  {CKA_CERTIFICATE_TYPE, &certType, sizeof(certType)};
  {CKA_TOKEN, &true, sizeof(true)},
  {CKA_LABEL, label, sizeof(label)-1},
  {CKA_SUBJECT, subject, sizeof(subject)},
  {CKA_ID, id, sizeof(id)},
  {CKA_VALUE, certificate, sizeof(certificate)}
};
@dmjones
Copy link
Contributor

dmjones commented Jan 15, 2019

Finding existing certificates and presenting them as *x509.Certificate objects seems like a reasonable thing to do.

For similar reasons to my comments in #15, I'm not convinced we should add certificate import support. If you can describe potential use cases where using miekg/pkcs11 wouldn't suffice, please let me know.

@dmjones dmjones added this to the v1.0.0 milestone Apr 15, 2019
@dmjones dmjones mentioned this issue Apr 30, 2019
@dmjones dmjones removed this from the v1.0.0 milestone Aug 7, 2019
@dmjones
Copy link
Contributor

dmjones commented Aug 22, 2019

Fixed in #53.

@dmjones dmjones closed this as completed Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants