new GpgSignature2020(linkedDataSigantureType, linkedDataSignatureVerificationKeyType, LDKeyClassopt, signeropt, proofSignatureKeyopt, dateopt, keyopt, useNativeCanonizeopt)
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
linkedDataSigantureType |
string | The name of the signature suite. | |
linkedDataSignatureVerificationKeyType |
string | The name verification key type for the signature suite. | |
LDKeyClass |
LDKeyClass |
<optional> |
provided by subclass or subclass overrides `getVerificationMethod`. This parameter is required for signing: |
signer |
function |
<optional> |
an optional signer. |
proofSignatureKey |
string |
<optional> |
the property in the proof that will contain the signature. |
date |
string | Date |
<optional> |
signing date to use if not passed. |
key |
LDKeyPair |
<optional> |
an optional crypto-ld KeyPair. |
useNativeCanonize |
boolean |
<optional> |
true to use a native canonize algorithm. |
Methods
(async) sign(verifyData, proof) → {Promise.<{object}>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
verifyData |
Uint8Array | . |
proof |
object |
Returns:
the proof containing the signature value.
- Type
- Promise.<{object}>
(async) verifySignature(verifyData, verificationMethod, document, proof, purpose, documentLoader, expansionMap) → {Promise.<{boolean}>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
verifyData |
Uint8Array | . |
verificationMethod |
object | . |
document |
object | the document the proof applies to. |
proof |
object | the proof to be verified. |
purpose |
ProofPurpose | |
documentLoader |
function | |
expansionMap |
function |
Returns:
Resolves with the verification result.
- Type
- Promise.<{boolean}>