Skip to main content

Class: PublicKey

Enum of valid public keys for the signature schemes supported by IOTA.

BCS

The BCS serialized form of this type is specified in bcs-schema.abnf.

The gap in the flag values of the public-key rule is intentional, as not all signature schemes support public keys.

There is also a base64 encoding for this type defined as:

base64-public-key = string ; which is valid base64 encoded
; and the decoded bytes are defined
; by flagged-public-key
flagged-public-key = (ed25519-flag ed25519-public-key) /
(secp256k1-flag secp256k1-public-key) /
(secp256r1-flag secp256r1-public-key) /
(passkey-flag passkey-public-key)

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

readonly [uniffiTypeNameSymbol]: "PublicKey" = "PublicKey";

Methods​

asEd25519()​

asEd25519(): Ed25519PublicKeyLike;

Returns​

Ed25519PublicKeyLike

Implementation of​

PublicKeyLike.asEd25519


asOptEd25519()​

asOptEd25519(): Ed25519PublicKeyLike | undefined;

Returns​

Ed25519PublicKeyLike | undefined

Implementation of​

PublicKeyLike.asOptEd25519


asOptPasskey()​

asOptPasskey(): PasskeyPublicKeyLike | undefined;

Returns​

PasskeyPublicKeyLike | undefined

Implementation of​

PublicKeyLike.asOptPasskey


asOptSecp256k1()​

asOptSecp256k1(): 
| Secp256k1PublicKeyLike
| undefined;

Returns​

| Secp256k1PublicKeyLike | undefined

Implementation of​

PublicKeyLike.asOptSecp256k1


asOptSecp256r1()​

asOptSecp256r1(): 
| Secp256r1PublicKeyLike
| undefined;

Returns​

| Secp256r1PublicKeyLike | undefined

Implementation of​

PublicKeyLike.asOptSecp256r1


asPasskey()​

asPasskey(): PasskeyPublicKeyLike;

Returns​

PasskeyPublicKeyLike

Implementation of​

PublicKeyLike.asPasskey


asSecp256k1()​

asSecp256k1(): Secp256k1PublicKeyLike;

Returns​

Secp256k1PublicKeyLike

Implementation of​

PublicKeyLike.asSecp256k1


asSecp256r1()​

asSecp256r1(): Secp256r1PublicKeyLike;

Returns​

Secp256r1PublicKeyLike

Implementation of​

PublicKeyLike.asSecp256r1


equals()​

equals(other): boolean;

Parameters​

other​

PublicKey

Returns​

boolean


isEd25519()​

isEd25519(): boolean;

Returns​

boolean

Implementation of​

PublicKeyLike.isEd25519


isPasskey()​

isPasskey(): boolean;

Returns​

boolean

Implementation of​

PublicKeyLike.isPasskey


isSecp256k1()​

isSecp256k1(): boolean;

Returns​

boolean

Implementation of​

PublicKeyLike.isSecp256k1


isSecp256r1()​

isSecp256r1(): boolean;

Returns​

boolean

Implementation of​

PublicKeyLike.isSecp256r1


scheme()​

scheme(): SignatureScheme;

Returns​

SignatureScheme

Implementation of​

PublicKeyLike.scheme


toBase64()​

toBase64(): string;

Encode this public key as a base64 string of its scheme-flagged byte representation

Returns​

string

Implementation of​

PublicKeyLike.toBase64


toBcs()​

toBcs(): ArrayBuffer;

Convert this type to BCS encoded bytes.

Returns​

ArrayBuffer

Implementation of​

PublicKeyLike.toBcs


toDebugString()​

toDebugString(): string;

Returns​

string


toDisplayString()​

toDisplayString(): string;

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

Returns​

string

Implementation of​

PublicKeyLike.toDisplayString


toJson()​

toJson(): string;

Convert this type to a JSON encoded string.

Returns​

string

Implementation of​

PublicKeyLike.toJson


toString()​

toString(): string;

Returns a string representation of an object.

Returns​

string


uniffiDestroy()​

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns​

void

Overrides​

UniffiAbstractObject.uniffiDestroy


uniffiUse()​

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters​

T​

T

Parameters​

block​

(obj) => T

Returns​

T

Inherited from​

UniffiAbstractObject.uniffiUse


fromBase64()​

static fromBase64(s): PublicKeyLike;

Decode a public key from a base64 string of its scheme-flagged byte representation

Parameters​

s​

string

Returns​

PublicKeyLike


fromBcs()​

static fromBcs(bcs): PublicKeyLike;

Create this type from BCS encoded bytes.

Parameters​

bcs​

ArrayBuffer

Returns​

PublicKeyLike


fromJson()​

static fromJson(json): PublicKeyLike;

Create this type from a JSON encoded string.

Parameters​

json​

string

Returns​

PublicKeyLike


instanceOf()​

static instanceOf(obj_): obj_ is PublicKey;

Parameters​

obj_​

any

Returns​

obj_ is PublicKey