Differences between version 3 and predecessor to the previous major change of ASN.1.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
| Newer page: | version 3 | Last edited on Friday, August 20, 2004 12:10:55 am | by PerryLorier | Revert |
| Older page: | version 2 | Last edited on Monday, September 1, 2003 9:44:56 am | by PerryLorier | Revert |
@@ -1,3 +1,44 @@
-An [ISO]/[ITU-T] standard for transmitting structured data on networks.
+An [ISO]/[ITU-T]/[CCITT
] standard for transmitting structured data on networks.
Used by [SSL] Certificates, [SNMP], [LDAP], and [IBM] Protocols.
+
+ASN.1 is a standard for transmitting structured binary data over networks.
+
+ASN.1 is made up of "encoding" of some chunk of data. An encoding is either:
+
+|Identifier Octets|Length Octets|Contents|
+(called the "Definite form")
+
+or
+
+|Identifier Octets|Length Octets|Contents|End of contets octets|
+(called the "Indefinite form")
+
+Definate form is in general used when you know the size of something before hand, indefinate form is used when the size of what you are encoding is unknown.
+
+The Identifier Octets are built up like so:
+|1|2|3|4|5|6|7|8
+||Class|Constructed|Tag
+
+where class is
+|Value|Class
+|00b|Universal
+|01b|Application
+|10b|Context specific
+|11b|Private
+
+If constructed is 1, then it means that this is a constructed type, not a primative one.
+
+The tag says which type it is, if the tag is under <=31, then it's value is used directly, otherwise the tag bits above are set to "11111" and then a sequence of octets that represent the number. The 8th bit of each octet is set to 1 to mean "more octets after this one". The low bits are the 7 bits of the tag, MSB first.
+
+"Choice" values encode which choice was taken directly into the tag bits. I don't know why.
+
+In definate encodings, if the 8th bit is 0, then it's a "short" encoding of the length, and the length is the lower 7 bits. If the 8th bit is set, and the lower 7 bits are how many __octets__ are used to encode the length(!). This allows for lengths up to 2**1008. The lower 7 bits being set is reserved for future expansion.
+
+End of contents is encoded as
+|Type|Length|Value
+|00|00| Absent
+
+Boolean is encoded as an octet, 0 for false, non-zero for true.
+Integers are encoded as a sequence of bytes, [MSB] first.
+Sequences are encoded as a series of encodings.
