Interface: PublicKeyLike
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)
Methods
asEd25519()
asEd25519(): Ed25519PublicKeyLike;
Returns
asOptEd25519()
asOptEd25519(): Ed25519PublicKeyLike | undefined;
Returns
Ed25519PublicKeyLike | undefined
asOptPasskey()
asOptPasskey(): PasskeyPublicKeyLike | undefined;
Returns
PasskeyPublicKeyLike | undefined
asOptSecp256k1()
asOptSecp256k1():
| Secp256k1PublicKeyLike
| undefined;
Returns
| Secp256k1PublicKeyLike
| undefined
asOptSecp256r1()
asOptSecp256r1():
| Secp256r1PublicKeyLike
| undefined;
Returns
| Secp256r1PublicKeyLike
| undefined
asPasskey()
asPasskey(): PasskeyPublicKeyLike;
Returns
asSecp256k1()
asSecp256k1(): Secp256k1PublicKeyLike;
Returns
asSecp256r1()
asSecp256r1(): Secp256r1PublicKeyLike;
Returns
isEd25519()
isEd25519(): boolean;
Returns
boolean
isPasskey()
isPasskey(): boolean;
Returns
boolean
isSecp256k1()
isSecp256k1(): boolean;
Returns
boolean
isSecp256r1()
isSecp256r1(): boolean;
Returns
boolean
scheme()
scheme(): SignatureScheme;
Returns
toBase64()
toBase64(): string;
Encode this public key as a base64 string of its scheme-flagged byte representation
Returns
string
toBcs()
toBcs(): ArrayBuffer;
Convert this type to BCS encoded bytes.
Returns
ArrayBuffer
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
toJson()
toJson(): string;
Convert this type to a JSON encoded string.
Returns
string