Aptos Unity SDK
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Properties | List of all members
Aptos.Accounts.Account Class Reference

Represents an Aptos Accounts.
An Aptos account is represented by an extended private key, a public key and it's authentication key. More...

Public Member Functions

 Account ()
 Create a new Aptos Account.
 
 Account (string privateKey, string publicKey)
 Initialize an account with a given private and public keys.
 
 Account (byte[] privateKey, byte[] publicKey)
 
string AuthKey ()
 Returns the Authentication Key for the associated account.
 
bool Verify (byte[] message, Signature signature)
 Verify a given signed message with the current account's public key.
 
Signature Sign (byte[] message)
 Sign a given byte array (data) with the current account's private key.
 

Static Public Member Functions

static Account Generate ()
 Utility function to be in par with the other SDKs , otherwise use the default constructor Account().
 
static Account LoadKey (string privateKeyHex)
 Creates an account from private key in string format.
 

Properties

PrivateKey PrivateKey [get, set]
 Private key representation.
 
PublicKey PublicKey [get, set]
 Public key representation.
 
AccountAddress AccountAddress [get, set]
 Account address representation.
 
byte[] PrivateKeyShort [get]
 32-byte representation of the private key.
 

Detailed Description

Represents an Aptos Accounts.
An Aptos account is represented by an extended private key, a public key and it's authentication key.

Constructor & Destructor Documentation

◆ Account()

Aptos.Accounts.Account.Account ( string  privateKey,
string  publicKey 
)
inline

Initialize an account with a given private and public keys.

Parameters
privateKeyThe private key.
publicKeyThe public key.

Member Function Documentation

◆ AuthKey()

string Aptos.Accounts.Account.AuthKey ( )
inline

Returns the Authentication Key for the associated account.

Returns
String representation of the authentication key

◆ Generate()

static Account Aptos.Accounts.Account.Generate ( )
static

Utility function to be in par with the other SDKs , otherwise use the default constructor Account().

Returns
A new account.

◆ LoadKey()

static Account Aptos.Accounts.Account.LoadKey ( string  privateKeyHex)
inlinestatic

Creates an account from private key in string format.

Parameters
privateKeyHexThe private key.
Returns
A new account.

◆ Sign()

Signature Aptos.Accounts.Account.Sign ( byte[]  message)

Sign a given byte array (data) with the current account's private key.

Parameters
message

The signature of the data.

Returns
The signature as an object

◆ Verify()

bool Aptos.Accounts.Account.Verify ( byte[]  message,
Signature  signature 
)
inline

Verify a given signed message with the current account's public key.

Parameters
messageThe signed message.
signatureThe signature of the message.
Returns
True is the signature is valid, False otherwise

The documentation for this class was generated from the following file: