Skip to content
asn1jsasn1jsasn1jsv4.1.0

der

const der: object

Pure DER validators for schema-aware checks of primitive encodings and SET ordering. These functions inspect the supplied bytes without parsing or changing them.

checkPrimitiveEncoding: (universalTag, isConstructed, content) => DerIssue | undefined

Checks the form and contents of a primitive UNIVERSAL value using DER rules. Returns undefined for a supported, valid value, or UNSUPPORTED_DER_TYPE when the type cannot be checked, including SEQUENCE and SET. Containers are not parsed. TeletexString, VideotexString, GraphicString and GeneralString contents are opaque; only their primitive form is checked.

number

boolean

Uint8Array

DerIssue | undefined

checkSetOfOrder: (encodings) => DerIssue | undefined

Checks SET OF ordering (X.690 11.6) of complete, already validated DER encodings. Ordering alone does not establish the validity of the supplied elements.

readonly Uint8Array<ArrayBufferLike>[]

DerIssue | undefined

checkSetOrder: (identifiers) => DerIssue | undefined

Checks SET ordering (X.690 10.3) by actual component tag class and tag number. Supply complete, already validated, minimally encoded identifier octets. The constructed flag is ignored and arbitrarily large tag numbers are supported. For an untagged CHOICE, supply the identifier of the encoded alternative.

readonly Uint8Array<ArrayBufferLike>[]

DerIssue | undefined

compareSetOfElements: (a, b) => number

Compares complete DER element encodings for SET OF ordering (X.690 11.6). The shorter input is conceptually padded with trailing zero octets. A negative, zero or positive result indicates less than, equal to or greater than. This comparison does not validate either encoding.

Uint8Array

Uint8Array

number