the DER format Buffer of this ASN.1 object.
the well parsed value of this ASN.1 object. It will be boolean, number, string, BitString, Date, array of ASN.1 objects and so on.
Returns true if two ASN.1 objects equally.
another ASN.1 object.
Expecting it is compound ASN.1 object and returns an array of sub ASN.1 objects.
error message to throw when it is not compound ASN.1 object.
Converts this ASN.1 object to a buffer of bytes in DER format.
Return a friendly JSON object for debuging.
Validates that the given ASN.1 object is at least a super set of the given ASN.1 structure. Only tag classes and types are checked. An optional map may also be provided to capture ASN.1 values while the structure is checked.
To capture an ASN.1 object, set an object in the validator's 'capture' parameter to the key to use in the capture map.
Objects in the validator may set a field 'optional' to true to indicate that it isn't necessary to pass validation.
Template object to validate.
Captures object to capture ASN.1 object.
Parse the value of this ASN.1 object when it is Class.UNIVERSAL. The value will be boolean, number, string, BitString, Date, array of ASN.1 objects and so on.
Creates a Tag.BOOLEAN ASN.1 object.
boolean value.
Creates an Tag.GENERALSTRING (specified in ISO-2022/ECMA-35) ASN.1 object.
general string.
Creates an Tag.GENERALIZEDTIME ASN.1 object.
date value.
Creates an Tag.IA5STRING (ASCII string) ASN.1 object.
ASCII string.
Creates a Tag.INTEGER ASN.1 object.
integer value or buffer.
Creates a Tag.NULL ASN.1 object.
Creates an Tag.NUMERICSTRING ASN.1 object.
numeric string.
Creates an Tag.OID (dot-separated numeric string) ASN.1 object.
dot-separated numeric string.
Creates an Tag.NUMERICSTRING ASN.1 object.
printable string.
Creates an Class.CONTEXT_SPECIFIC ASN.1 object.
Note: the tag means nothing with Class.CONTEXT_SPECIFIC
number.
an array of ASN.1 objects or a ASN.1 object.
when objs is a array, the isCompound will be set to true.
Creates an Tag.T61STRING (8-bit clean string) ASN.1 object.
8-bit clean string.
Creates an Tag.UTCTIME ASN.1 object.
Note: GeneralizedTime has 4 digits for the year and is used for X.509. dates past 2049. Converting to a GeneralizedTime hasn't been implemented yet.
date value.
Creates an Tag.UTF8 ASN.1 object.
utf8 string.
Parse a ASN.1 object from a buffer in DER format.
the buffer to parse.
deeply parse or not.
Parse a Tag.BITSTRING value from ASN.1 object' value.
the buffer to parse.
Parse a Tag.BOOLEAN value from ASN.1 object' value.
the buffer to parse.
Parse a Tag.GENERALSTRING string from ASN.1 object' value.
the buffer to parse.
Parse a Tag.GENERALIZEDTIME date from ASN.1 object' value.
the buffer to parse.
Parse a Tag.IA5STRING string from ASN.1 object' value.
the buffer to parse.
Parse a Tag.INTEGER value from ASN.1 object' value.
the buffer to parse.
Parse a Tag.INTEGER value as a number from ASN.1 object' value.
the buffer to parse.
Parse a Tag.INTEGER value as a hex string(for BigInt) from ASN.1 object' value.
the buffer to parse.
Parse a Tag.NULL value from ASN.1 object' value.
the buffer to parse.
Parse a Tag.UTF8 string from ASN.1 object' value.
the buffer to parse.
Parse a Tag.OID value from ASN.1 object' value.
the buffer to parse.
Parse a Tag.PRINTABLESTRING string from ASN.1 object' value.
the buffer to parse.
Parse a Tag.T61STRING string from ASN.1 object' value.
the buffer to parse.
Parse a Tag.UTCTIME date of Tag.GENERALIZEDTIME date from ASN.1 object' value.
the type.
the buffer to parse.
Parse a Tag.UTCTIME date from ASN.1 object' value.
the buffer to parse.
Parse a Tag.UTF8 string from ASN.1 object' value.
the buffer to parse.
Generated using TypeDoc
Implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690.
See also
A Layman's Guide to a Subset of ASN.1, BER, and DER,'' http://luca.ntop.org/Teaching/Appunti/asn1.html.
ASN.1 is a syntax for specifying abstract objects and BER, DER, PER, XER etc are different encoding formats for those objects. Here, we'll be dealing with DER, the Distinguished Encoding Rules. DER is used in X.509 because it's fast to parse and, unlike BER, has a unique encoding for every object. When calculating hashes over objects, it's important that the resulting bytes be the same at both ends and DER removes this margin of error. ASN.1 is very complex and this package doesn't attempt to implement everything by any means.
DER Encoding of ASN.1 Types: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540792(v=vs.85).aspx