Skip to content
PKIjsPKIjsPKIjsv4.0.1

Time

Represents the Time structure described in RFC5280

new Time(parameters?): Time

Initializes a new instance of the Time class

TimeParameters = {}

Initialization parameters

Time

PkiObject.constructor

type: TimeType

0 - UTCTime; 1 - GeneralizedTime; 2 - empty value

ITime.type


value: Date

Value of the TIME class

ITime.value


static CLASS_NAME: string = "Time"

Name of the class

PkiObject.CLASS_NAME

get className(): string

string

PkiObject.className

fromSchema(schema): void

Converts parsed ASN.1 object into current class

any

ASN.1 schema

void

PkiObject.fromSchema


toJSON(): TimeJson

Converts the class to JSON object

TimeJson

JSON object

PkiObject.toJSON


toSchema(): UTCTime | GeneralizedTime

Converts current object to ASN.1 object and sets correct values

UTCTime | GeneralizedTime

ASN.1 object

PkiObject.toSchema


toString(encoding?): string

"hex" | "base64" | "base64url" = "hex"

string

PkiObject.toString


static blockName(): string

Returns block name

string

Returns string block name

PkiObject.blockName


static defaultValues(memberName): TimeType

Returns default values for all class members

"type"

String name for a class member

TimeType

Default value

PkiObject.defaultValues

static defaultValues(memberName): Date

Returns default values for all class members

"value"

String name for a class member

Date

Default value

PkiObject.defaultValues


static fromBER<T>(this, raw): T

Creates PKI object from the raw data

T extends PkiObject

PkiObjectConstructor<T>

BufferSource

ASN.1 encoded raw data

T

Initialized and filled current class object

PkiObject.fromBER


static schema(parameters?, optional?): any

Returns value of pre-defined ASN.1 schema for current class

TimeSchema = {}

Input parameters for the schema

boolean = false

Flag that current schema should be optional

any

ASN.1 schema object

PkiObject.schema