Class: CryptosuiteApi ​
Defined in: packages/api/src/crypto.ts:77
Schnorr cryptosuite operations.
Optionally stateful: call use to set a current cryptosuite, then call createProof, verifyProof, or toDataIntegrityProof without passing an explicit instance. Pass an explicit instance to any method to override the current one for that call.
Constructors ​
Constructor ​
new CryptosuiteApi():
CryptosuiteApi
Returns ​
CryptosuiteApi
Accessors ​
current ​
Get Signature ​
get current():
BIP340Cryptosuite|undefined
Defined in: packages/api/src/crypto.ts:81
The currently active cryptosuite, or undefined if none is set.
Returns ​
BIP340Cryptosuite | undefined
Methods ​
clear() ​
clear():
void
Defined in: packages/api/src/crypto.ts:96
Clear the current cryptosuite.
Returns ​
void
create() ​
create(
multikey):BIP340Cryptosuite
Defined in: packages/api/src/crypto.ts:105
Create a new Schnorr cryptosuite from a multikey.
Parameters ​
multikey ​
The Schnorr multikey to use.
Returns ​
The created Schnorr cryptosuite.
createFromKms() ​
createFromKms(
id,controller,keyId,kms):BIP340Cryptosuite
Defined in: packages/api/src/crypto.ts:117
Convenience: resolve a key from the KMS and create a cryptosuite in one step.
Parameters ​
id ​
string
The multikey ID (e.g. '#initialKey').
controller ​
string
The DID that controls this key.
keyId ​
string
The KMS key identifier to resolve.
kms ​
The KeyManagerApi instance holding the key.
Returns ​
The created Schnorr cryptosuite.
createProof() ​
createProof(
document,config,cryptosuite?):DataIntegrityProofObject
Defined in: packages/api/src/crypto.ts:147
Create a proof for a document. Uses the current cryptosuite when cryptosuite is omitted.
Parameters ​
document ​
The document to create the proof for.
config ​
Configuration for the proof creation.
cryptosuite? ​
Optional explicit cryptosuite; defaults to current.
Returns ​
The created proof.
toDataIntegrityProof() ​
toDataIntegrityProof(
cryptosuite?):BIP340DataIntegrityProof
Defined in: packages/api/src/crypto.ts:134
Convert a cryptosuite to a Data Integrity Proof instance. Uses the current cryptosuite when cryptosuite is omitted.
Parameters ​
cryptosuite? ​
Optional explicit cryptosuite to convert.
Returns ​
The Data Integrity Proof instance.
use() ​
use(
cs):this
Defined in: packages/api/src/crypto.ts:90
Set the current cryptosuite for subsequent operations.
Parameters ​
cs ​
The cryptosuite to activate.
Returns ​
this
this for chaining.
verifyProof() ​
verifyProof(
document,cryptosuite?):VerificationResult
Defined in: packages/api/src/crypto.ts:163
Verify a proof for a document. Uses the current cryptosuite when cryptosuite is omitted.
Parameters ​
document ​
The document to verify the proof for.
cryptosuite? ​
Optional explicit cryptosuite; defaults to current.
Returns ​
The full verification result.