Classes

Signature

An Ed25519 Signature represents a cryptographic proof that a private key signed some data. It can be verified with the private key's public key.

Methods

__getClassname()

\_\_getClassname(): `string`

free()

free(): `void`

serialize()

serialize(): `Uint8Array`

Serializes the signature to a byte array.


toHex()

toHex(): `string`

Formats the signature into a hex string.


create()

`static` create(`private_key`, `public_key`, `data`): [Signature](Signature)

Create a signature from a private key and its public key over byte data.

ParameterType
FirstUint8Array
Returns
Signature

deserialize()

`static` deserialize(`bytes`): [Signature](Signature)

Deserializes an Ed25519 signature from a byte array.

Throws when the byte array contains less than 64 bytes.

ParameterType
FirstUint8Array
Returns
Signature

fromAsn1()

`static` fromAsn1(`bytes`): [Signature](Signature)

Parses an Ed25519 signature from its ASN.1 representation.

ParameterType
FirstUint8Array
Returns
Signature

fromHex()

`static` fromHex(`hex`): [Signature](Signature)

Parses an Ed25519 signature from its hex representation.

Throws when the string is not valid hex format or when it represents less than 64 bytes.

ParameterType
Firststring
Returns
Signature

On this page