Skip to main content

Class: SimpleSignature

A basic signature

This enumeration defines the set of simple or basic signature schemes supported by IOTA. Most signature schemes supported by IOTA end up comprising of a at least one simple signature scheme.

BCS

The BCS serialized form for this type is defined by the following ABNF:

simple-signature = bytes ; where the contents of the bytes are defined by
; <simple-signature-body>
simple-signature-body = (ed25519-flag ed25519-signature ed25519-public-key) /
(secp256k1-flag secp256k1-signature secp256k1-public-key) /
(secp256r1-flag secp256r1-signature secp256r1-public-key)

Note: Due to historical reasons, signatures are serialized slightly different from the majority of the types in IOTA. In particular if a signature is ever embedded in another structure it generally is serialized as bytes meaning it has a length prefix that defines the length of the completely serialized signature.

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

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

Methods​

ed25519PubKey()​

ed25519PubKey(): Ed25519PublicKeyLike;

Returns​

Ed25519PublicKeyLike

Implementation of​

SimpleSignatureLike.ed25519PubKey


ed25519PubKeyOpt()​

ed25519PubKeyOpt(): Ed25519PublicKeyLike | undefined;

Returns​

Ed25519PublicKeyLike | undefined

Implementation of​

SimpleSignatureLike.ed25519PubKeyOpt


ed25519Sig()​

ed25519Sig(): Ed25519SignatureLike;

Returns​

Ed25519SignatureLike

Implementation of​

SimpleSignatureLike.ed25519Sig


ed25519SigOpt()​

ed25519SigOpt(): Ed25519SignatureLike | undefined;

Returns​

Ed25519SignatureLike | undefined

Implementation of​

SimpleSignatureLike.ed25519SigOpt


equals()​

equals(other): boolean;

Parameters​

other​

SimpleSignature

Returns​

boolean


hashCode()​

hashCode(): bigint;

Returns​

bigint


isEd25519()​

isEd25519(): boolean;

Returns​

boolean

Implementation of​

SimpleSignatureLike.isEd25519


isSecp256k1()​

isSecp256k1(): boolean;

Returns​

boolean

Implementation of​

SimpleSignatureLike.isSecp256k1


isSecp256r1()​

isSecp256r1(): boolean;

Returns​

boolean

Implementation of​

SimpleSignatureLike.isSecp256r1


scheme()​

scheme(): SignatureScheme;

Returns​

SignatureScheme

Implementation of​

SimpleSignatureLike.scheme


secp256k1PubKey()​

secp256k1PubKey(): Secp256k1PublicKeyLike;

Returns​

Secp256k1PublicKeyLike

Implementation of​

SimpleSignatureLike.secp256k1PubKey


secp256k1PubKeyOpt()​

secp256k1PubKeyOpt(): 
| Secp256k1PublicKeyLike
| undefined;

Returns​

| Secp256k1PublicKeyLike | undefined

Implementation of​

SimpleSignatureLike.secp256k1PubKeyOpt


secp256k1Sig()​

secp256k1Sig(): Secp256k1SignatureLike;

Returns​

Secp256k1SignatureLike

Implementation of​

SimpleSignatureLike.secp256k1Sig


secp256k1SigOpt()​

secp256k1SigOpt(): 
| Secp256k1SignatureLike
| undefined;

Returns​

| Secp256k1SignatureLike | undefined

Implementation of​

SimpleSignatureLike.secp256k1SigOpt


secp256r1PubKey()​

secp256r1PubKey(): Secp256r1PublicKeyLike;

Returns​

Secp256r1PublicKeyLike

Implementation of​

SimpleSignatureLike.secp256r1PubKey


secp256r1PubKeyOpt()​

secp256r1PubKeyOpt(): 
| Secp256r1PublicKeyLike
| undefined;

Returns​

| Secp256r1PublicKeyLike | undefined

Implementation of​

SimpleSignatureLike.secp256r1PubKeyOpt


secp256r1Sig()​

secp256r1Sig(): Secp256r1SignatureLike;

Returns​

Secp256r1SignatureLike

Implementation of​

SimpleSignatureLike.secp256r1Sig


secp256r1SigOpt()​

secp256r1SigOpt(): 
| Secp256r1SignatureLike
| undefined;

Returns​

| Secp256r1SignatureLike | undefined

Implementation of​

SimpleSignatureLike.secp256r1SigOpt


signatureBytes()​

signatureBytes(): ArrayBuffer;

The raw signature bytes, without the scheme flag or the public key.

Returns​

ArrayBuffer

Implementation of​

SimpleSignatureLike.signatureBytes


toBase64()​

toBase64(): string;

Base64-encode this signature as its flag || sig || pubkey bytes.

Returns​

string

Implementation of​

SimpleSignatureLike.toBase64


toBytes()​

toBytes(): ArrayBuffer;

Returns​

ArrayBuffer

Implementation of​

SimpleSignatureLike.toBytes


toDebugString()​

toDebugString(): string;

Returns​

string


toPublicKey()​

toPublicKey(): PublicKeyLike;

The public key embedded in this signature.

Returns​

PublicKeyLike

Implementation of​

SimpleSignatureLike.toPublicKey


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(base64): SimpleSignatureLike;

Decode a signature from the Base64 form produced by to_base64, i.e. base64 over the flag || sig || pubkey bytes.

Parameters​

base64​

string

Returns​

SimpleSignatureLike


instanceOf()​

static instanceOf(obj_): obj_ is SimpleSignature;

Parameters​

obj_​

any

Returns​

obj_ is SimpleSignature


newEd25519()​

static newEd25519(signature, publicKey): SimpleSignatureLike;

Parameters​

signature​

Ed25519SignatureLike

publicKey​

Ed25519PublicKeyLike

Returns​

SimpleSignatureLike


newSecp256k1()​

static newSecp256k1(signature, publicKey): SimpleSignatureLike;

Parameters​

signature​

Secp256k1SignatureLike

publicKey​

Secp256k1PublicKeyLike

Returns​

SimpleSignatureLike


newSecp256r1()​

static newSecp256r1(signature, publicKey): SimpleSignatureLike;

Parameters​

signature​

Secp256r1SignatureLike

publicKey​

Secp256r1PublicKeyLike

Returns​

SimpleSignatureLike