@did-btc1/method / CryptoSigner
Interface: CryptoSigner
Defined in: packages/method/src/btc1/key-manager/interface.ts:95
Methods
digest()
> digest(data
): Bytes
Defined in: packages/method/src/btc1/key-manager/interface.ts:118
Returns the sha256 hash of the input data.
Parameters
data
Uint8Array
The data to hash.
Returns
Bytes
The sha256 hash of the input data.
sign()
> sign(data
, keyUri?
): Promise
<Bytes
>
Defined in: packages/method/src/btc1/key-manager/interface.ts:102
Signs a message with a key pair.
Parameters
data
Hex
The data to sign.
keyUri?
string
The URI of the key to sign the data with.
Returns
Promise
<Bytes
>
The signature of the input data.
verify()
> verify(signature
, data
, keyUri?
): Promise
<boolean
>
Defined in: packages/method/src/btc1/key-manager/interface.ts:111
Verifies if a signature was produced by a key pair.
Parameters
signature
Bytes
The signature to verify.
data
Hex
The data that was signed.
keyUri?
string
The URI of the key to use for verification.
Returns
Promise
<boolean
>
A promise that resolves if the signature is valid, and rejects otherwise.