Forum Stats

  • 3,770,906 Users
  • 2,253,180 Discussions


RSA Public Key ASN.1 DER Encoded Output

843811 Member Posts: 49,851
Hi all,

I managed to created a pair of RSA Keys and print out the ASN.1 DER encoded format of the RSAPublicKey via getEncoded() method.

The beginning few blob (in hex.) of the output is:

30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 82 01...

My understanding of SubjectPublicKeyInfo ASN.1 structure and DER encoding allows me to understand mostly what I have written above; however, I am wondering what the first few blobs represents.

For the blob above, I interpret the first few blobs as the ASN.1's SEQUENCE; with DER Tag 0x30, then followed by DER Length 0x82; however, the DER Value doesn't start with another SEQUENCE for ASN.1 AlgorithIdentifier.

What I mean is, what are the DER Value 0x01 0x22 (the 3rd and 4th hex. blob) in above mean? Shouldn't AlgorithmIdentifier be there, instead of after these blobs?


Hon Hwang.
This discussion has been closed.