Interface: Cryptosuite ​
Defined in: cryptosuite/interface.ts:28
Interface representing a Cryptographic Suite from the Verifiable Credential Data Integrity 1.0 spec. Cryptosuite
Properties ​
cryptosuite ​
cryptosuite:
string
Defined in: cryptosuite/interface.ts:37
An identifier for the cryptographic suite that can be used to verify the proof.
multikey ​
multikey:
SchnorrMultikey
Defined in: cryptosuite/interface.ts:42
The SchnorrMultikey used by the cryptosuite
type ​
type:
string
Defined in: cryptosuite/interface.ts:32
The specific type of proof. Example types include DataIntegrityProof and Ed25519Signature2020
Methods ​
createProof() ​
createProof(
insecureDocument,config):DataIntegrityProofObject
Defined in: cryptosuite/interface.ts:50
Create a proof for an insecure document.
Parameters ​
insecureDocument ​
The document to create a proof for.
config ​
The config to use when creating the proof.
Returns ​
The proof for the document.
generateHash() ​
generateHash(
canonicalConfig,canonicalDocument):Hex
Defined in: cryptosuite/interface.ts:74
Generate a hash of the canonical proof configuration and document.
Parameters ​
canonicalConfig ​
string
The canonicalized proof configuration.
canonicalDocument ​
string
The canonicalized document.
Returns ​
The hash string of the proof configuration and document.
proofConfiguration() ​
proofConfiguration(
config):string
Defined in: cryptosuite/interface.ts:82
Configure the proof by canonicalzing it.
Parameters ​
config ​
The config to use when transforming the proof.
Returns ​
string
The canonicalized proof configuration.
Throws ​
if the proof configuration cannot be canonicalized.
proofSerialization() ​
proofSerialization(
hash,config):Bytes
Defined in: cryptosuite/interface.ts:91
Serialize the proof into a byte array.
Parameters ​
hash ​
The canonicalized proof configuration.
config ​
The config to use when serializing the proof.
Returns ​
The serialized proof.
Throws ​
if the multikey does not match the verification method.
proofVerification() ​
proofVerification(
hash,signature,config):boolean
Defined in: cryptosuite/interface.ts:101
Verify the proof by comparing the hash of the proof configuration and document to the proof bytes.
Parameters ​
hash ​
The canonicalized proof configuration.
signature ​
The serialized proof.
config ​
The config to use when verifying the proof.
Returns ​
boolean
True if the proof is verified, false otherwise.
Throws ​
if the multikey does not match the verification method.
transformDocument() ​
transformDocument(
document,config):string
Defined in: cryptosuite/interface.ts:66
Transform a document (secure didUpdateInvocation or insecure didUpdatePayload) into canonical form.
Parameters ​
document ​
The document to transform.
config ​
The config to use when transforming the document.
Returns ​
string
The canonicalized document.
Throws ​
if the document cannot be transformed.
verifyProof() ​
verifyProof(
secureDocument):VerificationResult
Defined in: cryptosuite/interface.ts:57
Verify a proof for a secure document.
Parameters ​
secureDocument ​
The secure document to verify.
Returns ​
The result of the verification.