CryptoApi
CryptoApi is a class representing Endpoint's API for cryptographic operations.
Static Methods
create
Creates instance of CryptoApi
Returns
[CryptoApi](/reference/cpp/endpoint/crypto/crypto-api)
·
CryptoApi object
Methods
signData
Creates a signature of data using given key.
Params
data
const core::Buffer &
buffer to sign
privateKey
const std::string &
key used to sign data
Returns
[Buffer](/reference/cpp/endpoint/core/buffer)
·
signature of data
verifySignature
Validate a signature of data using given key.
Params
data
const core::Buffer &
buffer
signature
const core::Buffer &
signature of data to verify
publicKey
const std::string &
public ECC key in BASE58DER format used to validate data
Returns
bool
·
data validation result
generatePrivateKey
Generates a new private ECC key.
Params
randomSeed
const std::optional<std::string> &
optional string used as the base to generate the new key
Returns
std::string
·
generated ECC key in WIF format
derivePrivateKey
Generates a new private ECC key from a password using pbkdf2.
Params
password
const std::string &
the password used to generate the new key
salt
const std::string &
random string (additional input for the hashing function)
Returns
std::string
·
generated ECC key in WIF format
derivePublicKey
Generates a new public ECC key as a pair for an existing private key.
Params
privateKey
const std::string &
Returns
std::string
·
generated ECC key in BASE58DER format
generateKeySymmetric
Generates a new symmetric key.
Returns
[Buffer](/reference/cpp/endpoint/core/buffer)
·
generated key
encryptDataSymmetric
Encrypts buffer with a given key using AES.
Params
data
const core::Buffer &
buffer to encrypt
symmetricKey
const core::Buffer &
key used to encrypt data
Returns
[Buffer](/reference/cpp/endpoint/core/buffer)
·
encrypted data buffer
decryptDataSymmetric
Decrypts buffer with a given key using AES.
Params
data
const core::Buffer &
buffer to decrypt
symmetricKey
const core::Buffer &
key used to decrypt data
Returns
[Buffer](/reference/cpp/endpoint/core/buffer)
·
plain (decrypted) data buffer
convertPEMKeytoWIFKey
Converts given private key in PEM format to its WIF format.
Params
pemKey
const std::string &
private key to convert
Returns
std::string
·
private key in WIF format
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.