Protected
constructorReturns a new instance of this class assuring the formal validity of the arguments used to build the object.
The purpose of the certificate.
The payload containing type and content.
The content of the payload.
The type of the payload.
The domain associated with the certificate.
The time at which the certificate is created; must be a positive safe integer.
The signer of the certificate; must be a valid address.
Optional
signature: stringThe signature of the certificate; optional parameter.
Readonly
domainReturn the description of the context of validity of this certificate.
Readonly
payloadReturns the content of the certificate.
Readonly
content: stringReturn the content serialized as a string.
Readonly
type: stringReturn the description of the type of content.
Readonly
purposeReturn the intended use or context of the certificate.
Optional
signatureReturn the signature computed evaluating the properties of this object and the private key of the signer.
Readonly
signerReturn the address of the entity signed the certificate, as
a lowercase hexadecimal expression prefixed by 0x
.
Readonly
timestampThe value expressed as of milliseconds elapsed since the epoch, when the certificate was issued.
Encodes the current certificate instance into a Uint8Array representation.
The encoded Uint8Array representation of the current certificate instance.
This method normalizes the content by:
"
when serialized as JSON before encoding as bytes.Signs the current object using a given private key.
The signature is computed encoding this object according the following normalization rules:
"
when serialized as JSON
before to be encoded as bytes;The private key used for signing.
The current instance after signing.
Verifies the certificate by checking its signature.
This method supports signer mixed-case checksum address encoding.
Protected
Static
encodeEncodes a given object into a Uint8Array representation applying the following operation to normalize the content:
"
when serialized as JSON
before to be encoded as bytes;The input object to be encoded.
The encoded Uint8Array representation of the input object.
Static
ofCreates a new Certificate instance from the provided CertificateData.
The data required to create the Certificate.
A new Certificate instance.
If the provided data is invalid:
This method supports signer mixed-case checksum address encoding.
The Certificate class provides functionality to create, sign, and verify certificates. It implements the CertificateData interface.
Remarks
The properties of those class are immutable, except signature, because properties are part of the signature computation. The signature is used of extract and match the signer. The fact the properties are immutable assure is not possible to create an object tampering properties and carry on the legitimate signature and signer address of the object before tampering to make tampered content to result in a validated certificate.
Implements
CertificateData