Skip to main content

Signature

Class Signature

Cryptographic signature of a message signed by an Aleo account

Methods

sign

Sign a message with a private key

sign(private_key, message)Signature
ParametersTypeDescription
private_keyPrivateKeyThe private key to sign the message with
messageUint8ArrayByte representation of the message to sign
returnSignatureSignature of the message

to_address

Get an address from a signature.

to_address()Address
ParametersTypeDescription
returnAddressAddress object

challenge

Get the challenge of a signature.

challenge()Scalar
ParametersTypeDescription
returnScalar**

response

Get the response of a signature.

response()Scalar
ParametersTypeDescription
returnScalar**

verify

Verify a signature of a message with an address

verify(address, message) ► boolean
ParametersTypeDescription
addressAddressThe address to verify the signature with
messageUint8ArrayByte representation of the message to verify
returnbooleanTrue if the signature is valid, false otherwise

fromBytesLe

Get a signature from a series of bytes.

fromBytesLe(bytes)Signature
ParametersTypeDescription
bytesUint8ArrayA left endian byte array representing the signature.
returnSignatureThe signature object.

toBytesLe

Get the left endian byte array representation of the signature.

toBytesLe()Uint8Array
ParametersTypeDescription
returnUint8Array**

fromBitsLe

Get a signature from a series of bits represented as a boolean array.

fromBitsLe(bits)Signature
ParametersTypeDescription
bitsArrayA left endian boolean array representing the bits of the signature.
returnSignatureThe signature object.

toBitsLe

Get the left endian boolean array representation of the bits of the signature.

toBitsLe()Array.<any>
ParametersTypeDescription
returnArray.<any>**

toFields

Get the field array representation of the signature.

toFields()Array.<any>
ParametersTypeDescription
returnArray.<any>**

from_string

Get a signature from a string representation of a signature

from_string(signature)Signature
ParametersTypeDescription
signaturestringString representation of a signature
returnSignatureSignature

to_string

Get a string representation of a signature

to_string() ► string
ParametersTypeDescription
returnstringString representation of a signature

toPlaintext

Get the plaintext representation of the signature.

toPlaintext()Plaintext
ParametersTypeDescription
returnPlaintext**