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
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

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 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.