Skip to main content

Class: WebCryptoSigner

Extends

  • Signer

Constructors

Constructor

new WebCryptoSigner(privateKey, publicKey): WebCryptoSigner;

Parameters

ParameterType
privateKeyCryptoKey
publicKeyUint8Array

Returns

WebCryptoSigner

Overrides

Signer.constructor

Properties

PropertyType
privateKeyCryptoKey

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

ParameterType
bytesUint8Array
intentIntentScope

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

ParameterType
bytesUint8Array
intentIntentScope

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

ParameterType
bytesUint8Array

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

ParameterType
bytesUint8Array

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

ParameterType
__namedParameters{ extractable?: boolean; }
__namedParameters.extractable?boolean

Returns

Promise<WebCryptoSigner>


import()

static import(data): WebCryptoSigner;

Imports a keypair using the value returned by export().

Parameters

ParameterType
dataExportedWebCryptoKeypair

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

ExportedWebCryptoKeypair


getPublicKey()

getPublicKey(): Secp256r1PublicKey;

The public key for this keypair

Returns

Secp256r1PublicKey

Overrides

Signer.getPublicKey

sign()

sign(bytes): Promise<Uint8Array>;

Parameters

ParameterType
bytesUint8Array

Returns

Promise<Uint8Array>

Overrides

Signer.sign