Skip to main content

Keypair

@iota/iota-sdk


@iota/iota-sdk / cryptography / Keypair

Abstract Class: Keypair

Defined in: sdk/typescript/src/cryptography/keypair.ts:100

TODO: Document

Extends

Extended by

Constructors

Constructor

new Keypair(): Keypair

Returns

Keypair

Inherited from

Signer.constructor

Methods

getKeyScheme()

abstract getKeyScheme(): SignatureScheme

Defined in: sdk/typescript/src/cryptography/keypair.ts:92

Get the key scheme of the keypair: Secp256k1 or ED25519

Returns

SignatureScheme

Inherited from

Signer.getKeyScheme


getPublicKey()

abstract getPublicKey(): PublicKey

Defined in: sdk/typescript/src/cryptography/keypair.ts:97

The public key for this keypair

Returns

PublicKey

Inherited from

Signer.getPublicKey


getSecretKey()

abstract getSecretKey(): string

Defined in: sdk/typescript/src/cryptography/keypair.ts:104

This returns the Bech32 secret key string for this keypair.

Returns

string


sign()

abstract sign(bytes): Promise<Uint8Array<ArrayBufferLike>>

Defined in: sdk/typescript/src/cryptography/keypair.ts:34

Parameters

bytes

Uint8Array

Returns

Promise<Uint8Array<ArrayBufferLike>>

Inherited from

Signer.sign


signPersonalMessage()

signPersonalMessage(bytes): Promise<{ bytes: string; signature: string; }>

Defined in: sdk/typescript/src/cryptography/keypair.ts:73

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


signTransaction()

signTransaction(bytes): Promise<SignatureWithBytes>

Defined in: sdk/typescript/src/cryptography/keypair.ts:67

Signs provided transaction by calling signWithIntent() with a TransactionData provided as intent scope

Parameters

bytes

Uint8Array

Returns

Promise<SignatureWithBytes>

Inherited from

Signer.signTransaction


signWithIntent()

signWithIntent(bytes, intent): Promise<SignatureWithBytes>

Defined in: sdk/typescript/src/cryptography/keypair.ts:50

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


toIotaAddress()

toIotaAddress(): string

Defined in: sdk/typescript/src/cryptography/keypair.ts:85

Returns

string

Inherited from

Signer.toIotaAddress


signingDigest()

static signingDigest(bytes, intent): Uint8Array

Defined in: sdk/typescript/src/cryptography/keypair.ts:40

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