Class: WebCryptoSigner
Extends
Signer
Constructors
Constructor
new WebCryptoSigner(privateKey, publicKey): WebCryptoSigner;
Parameters
| Parameter | Type |
|---|---|
privateKey | CryptoKey |
publicKey | Uint8Array |
Returns
WebCryptoSigner
Overrides
Signer.constructor
Properties
| Property | Type |
|---|---|
privateKey | CryptoKey |
Methods
signingDigest()
static signingDigest(bytes, intent): Uint8Array;
Sign messages with a specific intent. By combining the message bytes with the intent before hashing. Returns the digest.
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
intent | IntentScope |
Returns
Uint8Array
Inherited from
Signer.signingDigest
signWithIntent()
signWithIntent(bytes, intent): Promise<SignatureWithBytes>;
Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, it ensures that a signed message is tied to a specific purpose and domain separator is provided
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
intent | IntentScope |
Returns
Promise<SignatureWithBytes>
Inherited from
Signer.signWithIntent
signTransaction()
signTransaction(bytes): Promise<SignatureWithBytes>;
Signs provided transaction by calling signWithIntent() with a TransactionData provided as intent scope
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
Returns
Promise<SignatureWithBytes>
Inherited from
Signer.signTransaction
signPersonalMessage()
signPersonalMessage(bytes): Promise<{
bytes: string;
signature: string;
}>;
Signs provided personal message by calling signWithIntent() with a PersonalMessage provided as intent scope
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
Returns
Promise<{
bytes: string;
signature: string;
}>
Inherited from
Signer.signPersonalMessage
toIotaAddress()
toIotaAddress(): string;
Returns
string
Inherited from
Signer.toIotaAddress
generate()
static generate(__namedParameters?): Promise<WebCryptoSigner>;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | { extractable?: boolean; } |
__namedParameters.extractable? | boolean |
Returns
Promise<WebCryptoSigner>
import()
static import(data): WebCryptoSigner;
Imports a keypair using the value returned by export().
Parameters
| Parameter | Type |
|---|---|
data | ExportedWebCryptoKeypair |
Returns
WebCryptoSigner
getKeyScheme()
getKeyScheme(): SignatureScheme;
Get the key scheme of the keypair: Secp256k1 or ED25519
Returns
SignatureScheme
Overrides
Signer.getKeyScheme
export()
export(): ExportedWebCryptoKeypair;
Exports the keypair so that it can be stored in IndexedDB.
Returns
getPublicKey()
getPublicKey(): Secp256r1PublicKey;
The public key for this keypair
Returns
Secp256r1PublicKey
Overrides
Signer.getPublicKey
sign()
sign(bytes): Promise<Uint8Array>;
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
Returns
Promise<Uint8Array>
Overrides
Signer.sign