Home Reference Source
import Certificate from 'pkijs/src/Certificate.js'
public class | source

Certificate

Class from RFC5280

Static Method Summary

Static Public Methods
public static

defaultValues(memberName: string): *

Return default values for all class members

public static

schema(parameters: Object): Object

Return value of asn1js schema for current class

Constructor Summary

Public Constructor
public

constructor(parameters: Object)

Constructor for Certificate class

Member Summary

Public Members
public

If present, this field is a SEQUENCE of one or more certificate extensions

public

The issuer field identifies the entity that has signed and issued the certificate

public

The subject and issuer unique identifiers are present in the certificate to handle the possibility of reuse of subject and/or issuer names over time

public

The date on which the certificate validity period ends

public

The date on which the certificate validity period begins

public

serialNumber: Integer

Serial number of the certificate

public

This field contains the algorithm identifier for the algorithm used by the CA to sign the certificate

public

The signatureAlgorithm field contains the identifier for the cryptographic algorithm used by the CA to sign this certificate

public

signatureValue: BitString

The signatureValue field contains a digital signature computed upon the ASN.1 DER encoded tbsCertificate

public

The subject field identifies the entity associated with the public key stored in the subject public key field

public

This field is used to carry the public key and identify the algorithm with which the key is used

public

The subject and issuer unique identifiers are present in the certificate to handle the possibility of reuse of subject and/or issuer names over time

public

ToBeSigned (TBS) part of the certificate

public

Version number

Method Summary

Public Methods
public

encodeTBS(): *

Create ASN.1 schema for existing values of TBS part for the certificate

public

fromSchema(schema: Object)

Convert parsed asn1js object into current class

public

getKeyHash(): *

Get SHA-1 hash value for subject public key

public

getPublicKey(parameters: undefined): *

Importing public key for current certificate

public

sign(privateKey: Object, hashAlgorithm: string): *

Make a signature for current value from TBS section

public

Convertion for the class to JSON object

public

toSchema(encodeFlag: boolean): Object

Convert current object to asn1js object and set correct values

public

verify(issuerCertificate: undefined): *

Static Public Methods

public static defaultValues(memberName: string): * source

Return default values for all class members

Params:

NameTypeAttributeDescription
memberName string

String name for a class member

Return:

*

public static schema(parameters: Object): Object source

Return value of asn1js schema for current class

Params:

NameTypeAttributeDescription
parameters Object

Input parameters for the schema

Return:

Object

asn1js schema object

Public Constructors

public constructor(parameters: Object) source

Constructor for Certificate class

Params:

NameTypeAttributeDescription
parameters Object
  • optional
  • default: {}
parameters.schema Object
  • optional

asn1js parsed value to initialize the class from

Public Members

public extensions: Array source

If present, this field is a SEQUENCE of one or more certificate extensions

public issuer: RelativeDistinguishedNames source

The issuer field identifies the entity that has signed and issued the certificate

public issuerUniqueID: ArrayBuffer source

The subject and issuer unique identifiers are present in the certificate to handle the possibility of reuse of subject and/or issuer names over time

public notAfter: Time source

The date on which the certificate validity period ends

public notBefore: Time source

The date on which the certificate validity period begins

public serialNumber: Integer source

Serial number of the certificate

public signature: AlgorithmIdentifier source

This field contains the algorithm identifier for the algorithm used by the CA to sign the certificate

public signatureAlgorithm: AlgorithmIdentifier source

The signatureAlgorithm field contains the identifier for the cryptographic algorithm used by the CA to sign this certificate

public signatureValue: BitString source

The signatureValue field contains a digital signature computed upon the ASN.1 DER encoded tbsCertificate

public subject: RelativeDistinguishedNames source

The subject field identifies the entity associated with the public key stored in the subject public key field

public subjectPublicKeyInfo: PublicKeyInfo source

This field is used to carry the public key and identify the algorithm with which the key is used

public subjectUniqueID: ArrayBuffer source

The subject and issuer unique identifiers are present in the certificate to handle the possibility of reuse of subject and/or issuer names over time

public tbs: ArrayBuffer source

ToBeSigned (TBS) part of the certificate

public version: number source

Version number

Public Methods

public encodeTBS(): * source

Create ASN.1 schema for existing values of TBS part for the certificate

Return:

*

public fromSchema(schema: Object) source

Convert parsed asn1js object into current class

Params:

NameTypeAttributeDescription
schema Object
  • nullable: false

public getKeyHash(): * source

Get SHA-1 hash value for subject public key

Return:

*

public getPublicKey(parameters: undefined): * source

Importing public key for current certificate

Params:

NameTypeAttributeDescription
parameters undefined
  • optional
  • default: undefined

Return:

*

public sign(privateKey: Object, hashAlgorithm: string): * source

Make a signature for current value from TBS section

Params:

NameTypeAttributeDescription
privateKey Object

Private key for "subjectPublicKeyInfo" structure

hashAlgorithm string
  • optional
  • default: "SHA-1"

Hashing algorithm

Return:

*

public toJSON(): Object source

Convertion for the class to JSON object

Return:

Object

public toSchema(encodeFlag: boolean): Object source

Convert current object to asn1js object and set correct values

Params:

NameTypeAttributeDescription
encodeFlag boolean
  • optional
  • default: false

Return:

Object

asn1js object

public verify(issuerCertificate: undefined): * source

Params:

NameTypeAttributeDescription
issuerCertificate undefined
  • optional
  • default: undefined

Return:

*