Class: WebCryptoSigner
Extends
Signer
Constructors
Constructor
new WebCryptoSigner(
privateKey,publicKey):WebCryptoSigner
Parameters
privateKey
CryptoKey
publicKey
Uint8Array
Returns
WebCryptoSigner
Overrides
Signer.constructor
Properties
privateKey
privateKey:
CryptoKey
Methods
signingDigest()
staticsigningDigest(bytes,intent):Uint8Array
Sign messages with a specific intent. By combining the message bytes with the intent before hashing. Returns the digest.
Parameters
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
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
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
bytes
Uint8Array
Returns
Promise<{ bytes: string; signature: string; }>
Inherited from
Signer.signPersonalMessage
toIotaAddress()
toIotaAddress():
string
Returns
string
Inherited from
Signer.toIotaAddress
generate()
staticgenerate(__namedParameters?):Promise<WebCryptoSigner>
Parameters
__namedParameters?
extractable?
boolean = false
Returns
Promise<WebCryptoSigner>
import()
staticimport(data):WebCryptoSigner
Imports a keypair using the value returned by export().
Parameters
data
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
bytes
Uint8Array
Returns
Promise<Uint8Array>
Overrides
Signer.sign