CryptoApi

expect class CryptoApi : AutoCloseable

Defines cryptographic methods.

actual class CryptoApi : AutoCloseable

Defines cryptographic methods.

actual class CryptoApi : AutoCloseable

Defines cryptographic methods.

Constructors

Link copied to clipboard
expect constructor()
constructor()
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
expect open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

Link copied to clipboard
expect fun convertPEMKeyToWIFKey(pemKey: String): String

Converts given private key in PEM format to its WIF format.

actual fun convertPEMKeyToWIFKey(pemKey: String): String

Converts given private key in PEM format to its WIF format.

actual external fun convertPEMKeyToWIFKey(pemKey: String): String

Converts given private key in PEM format to its WIF format.

Link copied to clipboard

Converts given public key in PGP format to its base58DER format.

Converts given public key in PGP format to its base58DER format.

actual external fun convertPGPAsn1KeyToBase58DERKey(pgpKey: String): String

Converts given public key in PGP format to its base58DER format.

Link copied to clipboard
expect fun decryptDataSymmetric(data: ByteArray, symmetricKey: ByteArray): ByteArray

Decrypts buffer with a given key using AES.

actual fun decryptDataSymmetric(data: ByteArray, symmetricKey: ByteArray): ByteArray

Decrypts buffer with a given key using AES.

actual external fun decryptDataSymmetric(data: ByteArray, symmetricKey: ByteArray): ByteArray

Decrypts buffer with a given key using AES.

Link copied to clipboard
expect fun derivePrivateKey2(password: String, salt: String): String

Generates a new private ECC key from a password using pbkdf2. This version of the derive function has a rounds count increased to 200k. This makes using this function a safer choice, but it makes the received key different than in the original version.

actual fun derivePrivateKey2(password: String, salt: String): String

Generates a new private ECC key from a password using pbkdf2. This version of the derive function has a rounds count increased to 200k. This makes using this function a safer choice, but it makes the received key different than in the original version.

actual external fun derivePrivateKey2(password: String, salt: String): String

Generates a new private ECC key from a password using pbkdf2. This version of the derive function has a rounds count increased to 200k. This makes using this function a safer choice, but it makes the received key different than in the original version.

Link copied to clipboard
expect fun derivePublicKey(privateKey: String): String

Generates a new public ECC key as a pair for an existing private key.

actual fun derivePublicKey(privateKey: String): String

Generates a new public ECC key as a pair for an existing private key.

actual external fun derivePublicKey(privateKey: String): String

Generates a new public ECC key as a pair for an existing private key.

Link copied to clipboard
expect fun encryptDataSymmetric(data: ByteArray, symmetricKey: ByteArray): ByteArray

Encrypts buffer with a given key using AES.

actual fun encryptDataSymmetric(data: ByteArray, symmetricKey: ByteArray): ByteArray

Encrypts buffer with a given key using AES.

actual external fun encryptDataSymmetric(data: ByteArray, symmetricKey: ByteArray): ByteArray

Encrypts buffer with a given key using AES.

Link copied to clipboard
expect fun entropyToMnemonic(entropy: ByteArray): String

Converts BIP-39 entropy to mnemonic.

actual fun entropyToMnemonic(entropy: ByteArray): String

Converts BIP-39 entropy to mnemonic.

actual external fun entropyToMnemonic(entropy: ByteArray): String

Converts BIP-39 entropy to mnemonic.

Link copied to clipboard
expect fun fromEntropy(entropy: ByteArray, password: String = ""): BIP39

Generates ECC key using BIP-39 entropy.

actual fun fromEntropy(entropy: ByteArray, password: String): BIP39

Generates ECC key using BIP-39 entropy.

actual external fun fromEntropy(entropy: ByteArray, password: String): BIP39

Generates ECC key using BIP-39 entropy.

Link copied to clipboard
expect fun fromMnemonic(mnemonic: String, password: String = ""): BIP39

Generates ECC key using BIP-39 mnemonic.

actual fun fromMnemonic(mnemonic: String, password: String): BIP39

Generates ECC key using BIP-39 mnemonic.

actual external fun fromMnemonic(mnemonic: String, password: String): BIP39

Generates ECC key using BIP-39 mnemonic.

Link copied to clipboard
expect fun generateBip39(strength: Long, password: String = ""): BIP39

Generates ECC key and BIP-39 mnemonic from a password using BIP-39.

actual fun generateBip39(strength: Long, password: String): BIP39

Generates ECC key and BIP-39 mnemonic from a password using BIP-39.

actual external fun generateBip39(strength: Long, password: String): BIP39

Generates ECC key and BIP-39 mnemonic from a password using BIP-39.

Link copied to clipboard

Generates a new symmetric key.

Generates a new symmetric key.

actual external fun generateKeySymmetric(): ByteArray

Generates a new symmetric key.

Link copied to clipboard
expect fun generatePrivateKey(randomSeed: String): String

Generates a new private ECC key.

actual fun generatePrivateKey(randomSeed: String): String

Generates a new private ECC key.

actual external fun generatePrivateKey(randomSeed: String): String

Generates a new private ECC key.

Link copied to clipboard
expect fun mnemonicToEntropy(mnemonic: String): ByteArray

Converts BIP-39 mnemonic to entropy.

actual fun mnemonicToEntropy(mnemonic: String): ByteArray

Converts BIP-39 mnemonic to entropy.

actual external fun mnemonicToEntropy(mnemonic: String): ByteArray

Converts BIP-39 mnemonic to entropy.

Link copied to clipboard
expect fun mnemonicToSeed(mnemonic: String, password: String = ""): ByteArray

Generates a seed used to generate a key using BIP-39 mnemonic with PBKDF2.

actual fun mnemonicToSeed(mnemonic: String, password: String): ByteArray

Generates a seed used to generate a key using BIP-39 mnemonic with PBKDF2.

actual external fun mnemonicToSeed(mnemonic: String, password: String): ByteArray

Generates a seed used to generate a key using BIP-39 mnemonic with PBKDF2.

Link copied to clipboard
expect fun signData(data: ByteArray, privateKey: String): ByteArray

Creates a signature of data using given key.

actual fun signData(data: ByteArray, privateKey: String): ByteArray

Creates a signature of data using given key.

actual external fun signData(data: ByteArray, privateKey: String): ByteArray

Creates a signature of data using given key.

Link copied to clipboard
expect fun verifySignature(data: ByteArray, signature: ByteArray, publicKey: String): Boolean

Validate a signature of data using given key.

actual fun verifySignature(data: ByteArray, signature: ByteArray, publicKey: String): Boolean

Validate a signature of data using given key.

actual external fun verifySignature(data: ByteArray, signature: ByteArray, publicKey: String): Boolean

Validate a signature of data using given key.