Does anyone know, or may point,hint me towards ressources where this is documented?
What I want is the information like:
PrivateKeyInfo ::= SEQUENCE {
version Version, (1byte)
algorithm AlgorithmIdentifier,(2byte)
PrivateKey OCTET STRING (xbyte)
}
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER, (1byte)
parameters ANY DEFINED BY algorithm OPTIONAL (ybyte)
}
// separators are encoded as 0
The cruzial part would really be the bytes and what the separators are, so I could parse it manually.
Actually I would be most happy to have just the information about all the formats. Because the first concern now is the openssl key-format. Secondly the openssh key format appears to be totally different.
Okay, basically prerequisite is to understand ASN.1
ASN.1 is a specification for an abstract synthax describing a datastructure. It is recursive and complex. And what I am interested in is the exact datastructure defined by it rather than the synthax.
So the simple top representation of any digestable token is:
|Type(1byte)|Length(1-xbyte)|Value(ybyte)|
Type: |class(2bit)|form(1bit)|tag(5bit)|
Type.class is defined to mean
Only the UNIVERSAL class is conforming with the displayed structure. The other classes could totally redefine everything.
Type.form is defined to mean
Type.tag is defined to mean
Length may be defined