Creating PKCS8 PrivateKeyInfo
seems to be missing 0x04 0x20
#82
Labels
help wanted
Extra attention is needed
PrivateKeyInfo
seems to be missing 0x04 0x20
#82
I'm trying to use
asn1-pkcs8
to construct aPrivateKeyInfo
for Ed25519 private key.I noticed that during construction the serialized buffer looks different from the one that is produced by
@peculiar/webcrypto
. It turns out that it's missing0x04 0x20
prefix on the key.If I don't concatenate
0x04 0x20
, the resulting key size is 46 bytes.But if I use webcrypto, I get 48 bytes.
The interface for
PrivateKeyInfo
requiresPrivateKey
which extendsOctetString
.I'm trying to reconcile the difference here, it seems webcrypto is more correct here. So I'm wondering if something was missing about how
PrivateKeyInfo
should be constructed.I noticed that
PrivateKeyInfo
inwebcrypto-core
is not the same as the one inasn1-pkcs8
.The text was updated successfully, but these errors were encountered: