Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RSA Public Key ASN.1 DER Encoded Output

843811Jul 20 2006
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?

Thanks.

Hon Hwang.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2006
Added on Jul 20 2006
0 comments
812 views