Class: SchnorrMultikey ​
Defined in: multikey/index.ts:32
SchnorrMultikey is an implementation of 2.1.1 Multikey. The publicKeyMultibase value of the verification method MUST be a base-58-btc Multibase encoding of a Multikey encoded secp256k1 public key. The secretKeyMultibase value of the verification method MUST be a Multikey encoding of a secp256k1 secret key.
Implements ​
SchnorrMultikey
Implements ​
Constructors ​
Constructor ​
new SchnorrMultikey(
params):SchnorrMultikey
Defined in: multikey/index.ts:63
Creates an instance of SchnorrMultikey.
Parameters ​
params ​
MultikeyParams
The parameters to create the multikey
Returns ​
SchnorrMultikey
Throws ​
if neither a publicKey nor a privateKey is provided
Properties ​
controller ​
readonlycontroller:string
Defined in: multikey/index.ts:46
The controller is the DID that controls the keys and information in the DID DOcument.
Implementation of ​
id ​
readonlyid:string
Defined in: multikey/index.ts:41
The id references which key to use for various operations in the DID Document.
Implementation of ​
type ​
readonlystatictype:string='Multikey'
Defined in: multikey/index.ts:36
The verification metod type.
Accessors ​
keyPair ​
Get Signature ​
get keyPair():
SchnorrKeyPair
Defined in: multikey/index.ts:84
Get the SchnorrKeyPair.
Returns ​
Implementation of ​
publicKey ​
Get Signature ​
get publicKey():
CompressedSecp256k1PublicKey
Defined in: multikey/index.ts:94
Get the Multikey CompressedSecp256k1PublicKey
Returns ​
Implementation of ​
secretKey ​
Get Signature ​
get secretKey():
Secp256k1SecretKey
Defined in: multikey/index.ts:101
Returns ​
Implementation of ​
signer ​
Get Signature ​
get signer():
boolean
Defined in: multikey/index.ts:259
Get signing ability of the Multikey (i.e. is there a valid Secp256k1SecretKey).
Returns ​
boolean
Implementation of ​
Methods ​
fromVerificationMethod() ​
fromVerificationMethod(
verificationMethod):Multikey
Defined in: multikey/index.ts:206
Convert a verification method to a multikey.
Parameters ​
verificationMethod ​
The verification method to convert.
Returns ​
Multikey instance.
Throws ​
if the verification method is missing required fields. if the verification method has an invalid type. if the publicKeyMultibase has an invalid prefix.
Implementation of ​
Multikey.fromVerificationMethod
fullId() ​
fullId():
string
Defined in: multikey/index.ts:178
Get the full id of the multikey
Returns ​
string
The full id of the multikey
Implementation of ​
json() ​
json():
MultikeyObject
Defined in: multikey/index.ts:267
Convert the multikey to a JSON object.
Returns ​
The multikey as a JSON object.
Implementation of ​
sign() ​
sign(
data,opts?):Bytes
Defined in: multikey/index.ts:127
Produce a signature over arbitrary data using schnorr or ecdsa.
Parameters ​
data ​
Data to be signed.
opts? ​
CryptoOptions
Options for signing.
Returns ​
Signature byte array.
Throws ​
if no private key is provided.
Implementation of ​
toCryptosuite() ​
toCryptosuite():
BIP340Cryptosuite
Defined in: multikey/index.ts:115
Constructs an instance of Cryptosuite from the current Multikey instance.
Returns ​
toVerificationMethod() ​
toVerificationMethod():
DidVerificationMethod
Defined in: multikey/index.ts:187
Convert the multikey to a verification method.
Returns ​
The verification method.
Implementation of ​
verify() ​
verify(
signature,data,opts?):boolean
Defined in: multikey/index.ts:157
Verify a signature using schnorr or ecdsa.
Parameters ​
signature ​
Signature for verification.
data ​
Data for verification.
opts? ​
CryptoOptions
Options for signing.
Returns ​
boolean
If the signature is valid against the public key.
Implementation of ​
create() ​
staticcreate(params):SchnorrMultikey
Defined in: multikey/index.ts:289
Static convenience method to create a new Multikey instance.
Parameters ​
params ​
MultikeyParams
The parameters to create the multikey
Returns ​
SchnorrMultikey
A new Multikey instance
Throws ​
if neither a publicKey nor a privateKey is provided
fromPrivateKey() ​
staticfromPrivateKey(params):SchnorrMultikey
Defined in: multikey/index.ts:301
Creates a Multikey instance from a private key
Parameters ​
params ​
The parameters to create the multikey
Returns ​
SchnorrMultikey
The new multikey instance
fromPublicKey() ​
staticfromPublicKey(params):Multikey
Defined in: multikey/index.ts:323
Creates a Multikey instance from a public key
Parameters ​
params ​
The parameters to create the multikey
Returns ​
The new multikey instance
fromPublicKeyMultibase() ​
staticfromPublicKeyMultibase(id,controller,publicKeyMultibase):SchnorrMultikey
Defined in: multikey/index.ts:338
Creates a Multikey instance from a public key multibase.
Parameters ​
id ​
string
The id of the multikey.
controller ​
string
The controller of the multikey.
publicKeyMultibase ​
string
The public key multibase of the multikey.
Returns ​
SchnorrMultikey
The new multikey instance.