What PKCS standard is the public key in the image below? It seems to me that it is PKCS#8, but what I've read makes me think that PKCS#8 only applies to private keys.

enter image description here

Here is the corresponding private key which is PKCS#8. Note they look identical except the private key only contains modulus and exponent info.

enter image description here

  • $\begingroup$ Found my answer here. Short story, the structure and contents of an SPKI public key and a PKCS#8 private key are identical except the public key lacks the private parts. Said another way, the public key only has the exponent and modulus. $\endgroup$ Commented Jan 5, 2023 at 3:31
  • 1
    $\begingroup$ Also SPKI wraps the algorithm-dependent part in BITSTRING while PKCS8 wraps it in OCTETSTRING. (Similarly the the algorithm-dependent signature in X.509/PKIX is wrapped by BITSTRING, as is the optional publickey in rfc5958, but the encrypted content in PKCS8 EncryptedPrivateKeyInfo and all contents in PKCS7/CMS are OCTETSTRING. OTOH extensions in X.509/PKIX, and some other things that derive from or copy it, use OID + OCTETSTRING.) $\endgroup$ Commented Jan 6, 2023 at 1:01
  • $\begingroup$ Thanks @dave_thompson_085 for that note, I had overlooked that. Another difference that I missed the first time is that the PKCS#8 structure also has a version element in the first sequence, but the X.509 SPKI does not. $\endgroup$ Commented Jan 6, 2023 at 1:08


Browse other questions tagged or ask your own question.