Class: EdDSAProofCreator

EdDSAProofCreator is a class that implements the Data Integrity EdDSA Cryptosuite v1.0 for the Ed25519 algorithm. It is used to create a proof of the input document.

See

Usage:

const proofCreator = new EdDSAProofCreator();
const signingRequest = await proofCreator.createSigningRequest(inputDocument, proofOptions);
const securedDocument = await proofCreator.attachSignature(inputDocument, signingRequest.proofConfig, signature);

Extends

  • ProofCreator<link:../type-aliases/EdDSA_ALGORITHM.md>

Constructors

Constructor

new EdDSAProofCreator(): EdDSAProofCreator

Returns

EdDSAProofCreator

Inherited from

ProofCreator<EdDSA_ALGORITHM>.constructor

Methods

attachSignature()

attachSignature<Input>(inputDocument, proofConfig, proofBytes): SecuredDataDocument<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

ProofConfig

The proof configuration.

======= proofBytes

Uint8Array

The bytes of the signature.

Returns

SecuredDataDocument<Input>

The input document with the attached signature.

Overrides

ProofCreator.attachSignature


canSign()

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.

Overrides

ProofCreator.canSign


constructProof()

constructProof(proofConfig, proofBytes): Proof

Constructs a proof from a signing request and a signature.

Parameters

======= proofConfig

ProofConfig

The proof configuration.

======= proofBytes

Uint8Array

The bytes of the signature.

Returns

Proof

The proof.

Overrides

ProofCreator.constructProof


createSigningRequest()

createSigningRequest<Input>(inputDocument, proofOptions): Promise<ProofSigningRequest<link:../type-aliases/EdDSA_ALGORITHM.md>>

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

Promise<ProofSigningRequest<link:../type-aliases/EdDSA_ALGORITHM.md>>

A signing request for the input document.

Overrides

ProofCreator.createSigningRequest