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
| Parameters | Type | Description |
|---|---|---|
| private_key | PrivateKey | The private key to sign the message with |
| message | Uint8Array | Byte representation of the message to sign |
| return | Signature | Signature of the message |
to_address
Get an address from a signature.
to_address() ► Address
| Parameters | Type | Description |
|---|---|---|
| return | Address | Address object |
challenge
Get the challenge of a signature.
challenge() ► Scalar
| Parameters | Type | Description |
|---|---|---|
| return | Scalar | ** |
response
Get the response of a signature.
response() ► Scalar
| Parameters | Type | Description |
|---|---|---|
| return | Scalar | ** |
verify
Verify a signature of a message with an address
verify(address, message) ► boolean
| Parameters | Type | Description |
|---|---|---|
| address | Address | The address to verify the signature with |
| message | Uint8Array | Byte representation of the message to verify |
| return | boolean | True if the signature is valid, false otherwise |
fromBytesLe
Get a signature from a series of bytes.
fromBytesLe(bytes) ► Signature
| Parameters | Type | Description |
|---|---|---|
| bytes | Uint8Array | A left endian byte array representing the signature. |
| return | Signature | The signature object. |
toBytesLe
Get the left endian byte array representation of the signature.
toBytesLe() ► Uint8Array
| Parameters | Type | Description |
|---|---|---|
| return | Uint8Array | ** |
fromBitsLe
Get a signature from a series of bits represented as a boolean array.
fromBitsLe(bits) ► Signature
| Parameters | Type | Description |
|---|---|---|
| bits | Array | A left endian boolean array representing the bits of the signature. |
| return | Signature | The signature object. |
toBitsLe
Get the left endian boolean array representation of the bits of the signature.
toBitsLe() ► Array.<any>
| Parameters | Type | Description |
|---|---|---|
| return | Array.<any> | ** |
toFields
Get the field array representation of the signature.
toFields() ► Array.<any>
| Parameters | Type | Description |
|---|---|---|
| return | Array.<any> | ** |
from_string
Get a signature from a string representation of a signature
from_string(signature) ► Signature
| Parameters | Type | Description |
|---|---|---|
| signature | string | String representation of a signature |
| return | Signature | Signature |
to_string
Get a string representation of a signature
to_string() ► string
| Parameters | Type | Description |
|---|---|---|
| return | string | String representation of a signature |
toPlaintext
Get the plaintext representation of the signature.
toPlaintext() ► Plaintext
| Parameters | Type | Description |
|---|---|---|
| return | Plaintext | ** |