Skip to main content

Class: KeyBag

Class from RFC5208

Hierarchy

Constructors

constructor

new KeyBag(parameters?): KeyBag

Constructor for Attribute class

Parameters

NameType
parametersObject

Returns

KeyBag

Overrides

PrivateKeyInfo.constructor

Properties

attributes

Optional attributes: Attribute[]

Inherited from

PrivateKeyInfo.attributes


parsedKey

Optional parsedKey: ECPrivateKey | RSAPrivateKey

Inherited from

PrivateKeyInfo.parsedKey


privateKey

privateKey: OctetString

Inherited from

PrivateKeyInfo.privateKey


privateKeyAlgorithm

privateKeyAlgorithm: AlgorithmIdentifier

Inherited from

PrivateKeyInfo.privateKeyAlgorithm


version

version: number

Inherited from

PrivateKeyInfo.version


CLASS_NAME

Static CLASS_NAME: string = "PrivateKeyInfo"

Name of the class

Inherited from

PrivateKeyInfo.CLASS_NAME

Accessors

className

get className(): string

Returns

string

Inherited from

PrivateKeyInfo.className

Methods

fromJSON

fromJSON(json): void

Converts JSON value into current object

Parameters

NameTypeDescription
jsonanyJSON object

Returns

void

Inherited from

PrivateKeyInfo.fromJSON


fromSchema

fromSchema(schema): void

Converts parsed ASN.1 object into current class

Parameters

NameTypeDescription
schemaanyASN.1 schema

Returns

void

Inherited from

PrivateKeyInfo.fromSchema


toJSON

toJSON(): JsonWebKey | PrivateKeyInfoJson

Converts the class to JSON object

Returns

JsonWebKey | PrivateKeyInfoJson

JSON object

Inherited from

PrivateKeyInfo.toJSON


toSchema

toSchema(): Sequence

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

Returns

Sequence

ASN.1 object

Inherited from

PrivateKeyInfo.toSchema


toString

toString(encoding?): string

Parameters

NameTypeDefault value
encoding"base64" | "base64url" | "hex""hex"

Returns

string

Inherited from

PrivateKeyInfo.toString


blockName

blockName(): string

Returns block name

Returns

string

Returns string block name

Inherited from

PrivateKeyInfo.blockName


defaultValues

defaultValues(memberName): any

Returns default values for all class members

Parameters

NameTypeDescription
memberNamestringString name for a class member

Returns

any

Default value

Inherited from

PrivateKeyInfo.defaultValues


fromBER

fromBER<T>(this, raw): T

Creates PKI object from the raw data

Type parameters

NameType
Textends PkiObject

Parameters

NameTypeDescription
thisPkiObjectConstructor<T>-
rawBufferSourceASN.1 encoded raw data

Returns

T

Initialized and filled current class object

Inherited from

PrivateKeyInfo.fromBER


schema

schema(parameters?): any

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

Parameters

NameTypeDescription
parametersSchemaParameters<{ attributes?: string ; privateKey?: string ; privateKeyAlgorithm?: AlgorithmIdentifierSchema ; version?: string }>Input parameters for the schema

Returns

any

ASN.1 schema object

Inherited from

PrivateKeyInfo.schema