Abstract Class: ProofCreator<ProofAlgorithms>

Abstract class for a proof creator.

Type Parameters

ProofAlgorithms

ProofAlgorithms extends string[]

The algorithms supported by the proof creator.

Constructors

Constructor

new ProofCreator<ProofAlgorithms>(): ProofCreator<ProofAlgorithms>

Returns

ProofCreator<ProofAlgorithms>

Methods

attachSignature()

abstract attachSignature<Input>(inputDocument, proofConfig, proofBytes): link:../type-aliases/SecuredDataDocument.md<Input> | Promise<link:../type-aliases/SecuredDataDocument.md<Input>>

Attaches a signature to the input document.

Type Parameters

======= Input

Input extends InputDocument

Parameters

======= inputDocument

Input

The input document to attach the signature to.

======= proofConfig

The proof configuration.

======= proofBytes

Uint8Array

The bytes of the signature.

Returns

link:../type-aliases/SecuredDataDocument.md<Input> | Promise<link:../type-aliases/SecuredDataDocument.md<Input>>

The input document with the attached signature.


canSign()

abstract canSign(proofType): boolean

Checks if the proof creator can sign with the given proof type.

Parameters

======= proofType

string

The proof type to check.

Returns

boolean

True if the proof creator can sign the given proof type, false otherwise.


constructProof()

abstract constructProof(proofConfig, proofBytes): Proof | Promise<link:../interfaces/Proof.md>

Constructs a proof from a signing request and a signature.

Parameters

======= proofConfig

The proof configuration.

======= proofBytes

Uint8Array

The bytes of the signature.

Returns

Proof | Promise<link:../interfaces/Proof.md>

The proof.


createSigningRequest()

abstract createSigningRequest<Input>(inputDocument, proofOptions): link:../interfaces/ProofSigningRequest.md<ProofAlgorithms> | Promise<link:../interfaces/ProofSigningRequest.md<ProofAlgorithms>>

Creates a signing request for the input document to create a proof.

Type Parameters

======= Input

Input extends InputDocument

Parameters

======= inputDocument

Input

The input document to create a proof for.

======= proofOptions

The options for the proof.

Returns

link:../interfaces/ProofSigningRequest.md<ProofAlgorithms> | Promise<link:../interfaces/ProofSigningRequest.md<ProofAlgorithms>>

A signing request for the input document.