Skip to content
PKIjsPKIjsPKIjsv4.0.1

KeyBag

Class from RFC5208

new KeyBag(parameters?): KeyBag

Constructor for Attribute class

{ }

KeyBag

PrivateKeyInfo.constructor

optional attributes?: Attribute[]

PrivateKeyInfo.attributes


optional parsedKey?: ECPrivateKey | RSAPrivateKey

PrivateKeyInfo.parsedKey


privateKey: OctetString

PrivateKeyInfo.privateKey


privateKeyAlgorithm: AlgorithmIdentifier

PrivateKeyInfo.privateKeyAlgorithm


version: number

PrivateKeyInfo.version


static CLASS_NAME: string = "PrivateKeyInfo"

Name of the class

PrivateKeyInfo.CLASS_NAME

get className(): string

string

PrivateKeyInfo.className

fromJSON(json): void

Converts JSON value into current object

any

JSON object

void

PrivateKeyInfo.fromJSON


fromSchema(schema): void

Converts parsed ASN.1 object into current class

any

ASN.1 schema

void

PrivateKeyInfo.fromSchema


toJSON(): JsonWebKey | PrivateKeyInfoJson

Converts the class to JSON object

JsonWebKey | PrivateKeyInfoJson

JSON object

PrivateKeyInfo.toJSON


toSchema(): Sequence

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

Sequence

ASN.1 object

PrivateKeyInfo.toSchema


toString(encoding?): string

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

string

PrivateKeyInfo.toString


static blockName(): string

Returns block name

string

Returns string block name

PrivateKeyInfo.blockName


static defaultValues(memberName): any

Returns default values for all class members

string

String name for a class member

any

Default value

PrivateKeyInfo.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

PrivateKeyInfo.fromBER


static schema(parameters?): any

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

SchemaParameters<{ attributes?: string; privateKey?: string; privateKeyAlgorithm?: AlgorithmIdentifierSchema; version?: string; }> = {}

Input parameters for the schema

any

ASN.1 schema object

PrivateKeyInfo.schema