-
Hi, OpenSSL 3.0.5 5 Jul 2022 (Library: OpenSSL 3.0.5 5 Jul 2022) The operation of reading the public key is ok: The operation with private key fails: Error making certificate request |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 17 replies
-
Certificate objects are not supported yet, it is one of the next items on my list. |
Beta Was this translation helpful? Give feedback.
-
Thanks. Why openssl req command that create CSR need something with Certificate objects from the provider? |
Beta Was this translation helpful? Give feedback.
-
When I have used openssl req it does not need a certificate. The CSR will contain the public key to be added in the new certificate. The CSR is signed by the matching private key. A test Certificate Management System ends up calling:
|
Beta Was this translation helpful? Give feedback.
-
comes from OpenSSL crypto/x509/x_pubkey.c line 359. In latest version https://github.com/openssl/openssl/blob/master/crypto/x509/x_pubkey.c#L364 It it is trying to create the "SubjectPublicKeyInfo" to be inserted into the CSR from the public key. OpenSSL store info on public and private in same structure. Smartcards and PKCS11 store them separately and to determine the type and size of the key, engine or provider need to access the public key. But it looks like your Yubikey is configured for a PIV card? NIST PIV specifications does not directly store a public key on the card. So there is catch-22 when creating a CSR. Only time card returns a public key is when a key is created which must be saved so it can be used in a CSR to create a certificate that will have the public key which can the be read for the card. How was the private key generated? I am not familiar with I am familiar with OpenSC piv-tool. When piv-tool generates a key, it writes the public to a file. The OpenSC pkcs11 module via card-piv.c will try and read certificate to get public key. If no certificate it will look in environment for path to the pubkey stored by piv-tool, to avoid the catch-22 situation. |
Beta Was this translation helpful? Give feedback.
-
So I have an encoder for SubjectPublicKeyInfo now, however there is an issue. In some cases the private key may contain the public key modulus and exponent (which are needed to generate the der SubjectPublicKeyInfo), but it is not a given in pkcs11 ... |
Beta Was this translation helpful? Give feedback.
-
The solution to this specific question should be in #87 |
Beta Was this translation helpful? Give feedback.
The solution to this specific question should be in #87