Module: utils/asn1

Methods

(static) alignBitstr(data) → {Buffer}

Align a bitstr.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Buffer

(static) explicit(br, type) → {Boolean}

Read implicit tag.

Parameters:
Name Type Description
br BufferReader
type Number
Source:
Returns:
Type
Boolean

(static) formatOID(data) → {String}

Format an OID buffer to a string.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
String

(static) implicit(br, type) → {Object}

Read next tag and assert implicit.

Parameters:
Name Type Description
br BufferReader
type Number
Source:
Throws:

on unexpected tag

Returns:
Type
Object

(static) parseCert(data) → {Object}

Read certificate from buffer.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Object

(static) parseRSAPrivate(data) → {Object}

Read RSA private key from buffer.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Object

(static) parseRSAPublic(data) → {Object}

Read RSA public key from buffer.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Object

(static) parseTBS(data) → {Object}

Read TBS certificate from buffer.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Object

(static) readAlgIdent(br) → {Object}

Read algorithm identifier.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readBitstr(br) → {Buffer}

Read and align an implicit bitstr.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Buffer

(static) readCert(br) → {Object}

Read an entire certificate.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readExplicitInt(br, type, readNumnullable) → {Buffer|Number}

Read explicit int.

Parameters:
Name Type Attributes Description
br BufferReader
type Number
readNum Boolean <nullable>
Source:
Returns:

-1 on not present.

Type
Buffer | Number

(static) readInt(br, readNumnullable) → {Buffer|Number}

Read implicit int.

Parameters:
Name Type Attributes Description
br BufferReader
readNum Boolean <nullable>
Source:
Returns:
Type
Buffer | Number

(static) readName(br) → {Array:.<Object:>}

Read implicit name.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Array:.<Object:>

(static) readOID(br) → {String}

Read and format OID to string.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
String

(static) readPubkey(br) → {Object}

Read an implicit pubkey.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readRSAPrivate(br) → {Object}

Read RSA private key.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readRSAPublic(br) → {Object}

Read RSA public key.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readSeq(br) → {Buffer}

Read implicit SEQ.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Buffer

(static) readSize(br, primitive) → {Number}

Read tag size.

Parameters:
Name Type Description
br BufferReader
primitive Boolean
Source:
Throws:

on indefinite size

Returns:
Type
Number

(static) readString(br) → {String}

Read an implicit string (any type).

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
String

(static) readTag(br) → {Object}

Read next tag.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readTBS(br) → {Object}

Read only the TBS certificate.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) readTime(br) → {Number}

Read implicit timestamp.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Number

(static) readValidity(br) → {Object}

Read implicit validity timerange.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
Object

(static) seq(br) → {BufferReader}

Read next implicit SEQ and return a new reader.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
BufferReader