Represents a 32-byte public key.
More...
|
| PublicKey (byte[] publicKey) |
| Initializes the PublicKey object with a given byte array.
|
|
| PublicKey (string key) |
| Initializes the PublicKey object with a given hexadecimal representation of public .
|
|
| PublicKey (ReadOnlySpan< byte > publicKey) |
| Initialize the PublicKey object from the given string.
|
|
bool | Verify (byte[] message, Signature signature) |
| Verify a signed message using the current public key.
|
|
bool | IsOnCurve () |
| Check if PubliKey is a valid on the Ed25519 curve.
|
|
void | Serialize (Serialization serializer) |
| Serialize public key.
|
|
override bool | Equals (object obj) |
|
override int | GetHashCode () |
| Value used as a hash.
|
|
override string | ToString () |
| ToString implementation return the key as a hex string.
|
|
|
const int | KeyLength = 32 |
| Public key length.
|
|
|
string | Key [get, set] |
| The key as a hexadecimal string.
|
|
byte[] | KeyBytes [get, set] |
| The key in bytes.
|
|
Represents a 32-byte public key.
◆ PublicKey() [1/3]
Aptos.Accounts.PublicKey.PublicKey |
( |
byte[] |
publicKey | ) |
|
|
inline |
Initializes the PublicKey object with a given byte array.
- Parameters
-
publicKey | The public key as byte array. |
◆ PublicKey() [2/3]
Aptos.Accounts.PublicKey.PublicKey |
( |
string |
key | ) |
|
|
inline |
Initializes the PublicKey object with a given hexadecimal representation of public .
- Parameters
-
key | The public key as a hexadecimal string.
Example: 0x586e3c8d447d7679222e139033e3820235e33da5091e9b0bb8f1a112cf0c8ff5 |
◆ PublicKey() [3/3]
Aptos.Accounts.PublicKey.PublicKey |
( |
ReadOnlySpan< byte > |
publicKey | ) |
|
|
inline |
Initialize the PublicKey object from the given string.
- Parameters
-
publicKey | The public key as a byte array. |
◆ GetHashCode()
override int Aptos.Accounts.PublicKey.GetHashCode |
( |
| ) |
|
Value used as a hash.
- Returns
◆ IsOnCurve()
bool Aptos.Accounts.PublicKey.IsOnCurve |
( |
| ) |
|
Check if PubliKey is a valid on the Ed25519 curve.
- Returns
- Returns true if public key is on the curve.
◆ operator byte[]()
static implicit Aptos.Accounts.PublicKey.operator byte[] |
( |
PublicKey |
publicKey | ) |
|
|
static |
Convert a PublicKey object to a byte array representation of a public key.
- Parameters
-
publicKey | The PublicKey object. |
- Returns
- Public key as a byte array.
◆ operator PublicKey() [1/2]
static Aptos.Accounts.PublicKey.operator PublicKey |
( |
byte[] |
keyBytes | ) |
|
|
explicitstatic |
Convert byte array representation of a public key to a PublicKey object.
- Parameters
-
keyBytes | The public key as a byte array. |
- Returns
- PublicKey object.
◆ operator PublicKey() [2/2]
static Aptos.Accounts.PublicKey.operator PublicKey |
( |
string |
publicKey | ) |
|
|
explicitstatic |
Convert Hex encoded string of a public key to PublicKey object.
- Parameters
-
publicKey | hex encoded string representing a public key. |
- Returns
- PublicKey object.
◆ operator string()
static implicit Aptos.Accounts.PublicKey.operator string |
( |
PublicKey |
publicKey | ) |
|
|
static |
Convert a PublicKey object to hex encoded string representatio public key.
- Parameters
-
publicKey | The PublicKey object. |
- Returns
- Hex encoded string representing the public key.
◆ operator!=()
Compares two public key objects for inequality.
- Parameters
-
- Returns
◆ operator==()
Compares two public key objects.
- Parameters
-
- Returns
- True if public keys are equal. False is public keys are not equal.
◆ Serialize()
void Aptos.Accounts.PublicKey.Serialize |
( |
Serialization |
serializer | ) |
|
|
inline |
Serialize public key.
- Parameters
-
serializer | Serializer object |
◆ ToString()
override string Aptos.Accounts.PublicKey.ToString |
( |
| ) |
|
ToString implementation return the key as a hex string.
- Returns
◆ Verify()
bool Aptos.Accounts.PublicKey.Verify |
( |
byte[] |
message, |
|
|
Signature |
signature |
|
) |
| |
|
inline |
Verify a signed message using the current public key.
- Parameters
-
message | Message that was signed. |
signature | The signature from the message. |
- Returns
The documentation for this class was generated from the following file:
- Aptos.Accounts/PublicKey.cs