Skip to main content

PublicKey

@iota/iota-sdk


@iota/iota-sdk / cryptography / PublicKey

Abstract Class: PublicKey

Defined in: sdk/typescript/src/cryptography/publickey.ts:38

A public key

Extended by​

Constructors​

Constructor​

new PublicKey(): PublicKey

Returns​

PublicKey

Methods​

equals()​

equals(publicKey): boolean

Defined in: sdk/typescript/src/cryptography/publickey.ts:42

Checks if two public keys are equal

Parameters​

publicKey​

PublicKey

Returns​

boolean


flag()​

abstract flag(): number

Defined in: sdk/typescript/src/cryptography/publickey.ts:157

Return signature scheme flag of the public key

Returns​

number


toBase64()​

toBase64(): string

Defined in: sdk/typescript/src/cryptography/publickey.ts:49

Return the base-64 representation of the public key

Returns​

string


toIotaAddress()​

toIotaAddress(): string

Defined in: sdk/typescript/src/cryptography/publickey.ts:139

Return the IOTA address associated with this Ed25519 public key

Returns​

string


toIotaBytes()​

toIotaBytes(): Uint8Array

Defined in: sdk/typescript/src/cryptography/publickey.ts:109

Returns the bytes representation of the public key prefixed with the signature scheme flag

Returns​

Uint8Array


toIotaBytesForAddress()​

toIotaBytesForAddress(): Uint8Array

Defined in: sdk/typescript/src/cryptography/publickey.ts:123

Returns the bytes representation of the public key prefixed with the signature scheme flag. If the signature scheme is ED25519, no prefix is set.

Returns​

Uint8Array


toIotaPublicKey()​

toIotaPublicKey(): string

Defined in: sdk/typescript/src/cryptography/publickey.ts:64

Return the IOTA representation of the public key encoded in base-64. An IOTA public key is formed by the concatenation of the scheme flag with the raw bytes of the public key

Returns​

string


toRawBytes()​

abstract toRawBytes(): Uint8Array

Defined in: sdk/typescript/src/cryptography/publickey.ts:152

Return the byte array representation of the public key

Returns​

Uint8Array


toString()​

toString(): never

Defined in: sdk/typescript/src/cryptography/publickey.ts:53

Returns​

never


verify()​

abstract verify(data, signature): Promise<boolean>

Defined in: sdk/typescript/src/cryptography/publickey.ts:162

Verifies that the signature is valid for the provided message

Parameters​

data​

Uint8Array

signature​

string | Uint8Array<ArrayBufferLike>

Returns​

Promise<boolean>


verifyAddress()​

verifyAddress(address): boolean

Defined in: sdk/typescript/src/cryptography/publickey.ts:101

Verifies that the public key is associated with the provided address

Parameters​

address​

string

Returns​

boolean


verifyPersonalMessage()​

verifyPersonalMessage(message, signature): Promise<boolean>

Defined in: sdk/typescript/src/cryptography/publickey.ts:83

Verifies that the signature is valid for the provided PersonalMessage

Parameters​

message​

Uint8Array

signature​

string | Uint8Array<ArrayBufferLike>

Returns​

Promise<boolean>


verifyTransaction()​

verifyTransaction(transaction, signature): Promise<boolean>

Defined in: sdk/typescript/src/cryptography/publickey.ts:94

Verifies that the signature is valid for the provided Transaction

Parameters​

transaction​

Uint8Array

signature​

string | Uint8Array<ArrayBufferLike>

Returns​

Promise<boolean>


verifyWithIntent()​

verifyWithIntent(bytes, signature, intent): Promise<boolean>

Defined in: sdk/typescript/src/cryptography/publickey.ts:69

Parameters​

bytes​

Uint8Array

signature​

string | Uint8Array<ArrayBufferLike>

intent​

IntentScope

Returns​

Promise<boolean>