Crypto

object Crypto

Cryptographic support routines.

This object contains various cryptographic primitives and is a wrapper to a platform- specific crypto library.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun checkSignature(publicKey: EcPublicKey, message: ByteArray, algorithm: Algorithm, signature: EcSignature)

Checks signature validity.

Link copied to clipboard

Creates an EC private key.

Link copied to clipboard
fun decrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray? = null): ByteArray

Message decryption.

Link copied to clipboard
fun digest(algorithm: Algorithm, message: ByteArray): ByteArray

Message digest function.

Link copied to clipboard
fun encrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messagePlaintext: ByteArray, aad: ByteArray? = null): ByteArray

Message encryption.

Link copied to clipboard

Performs Key Agreement.

Link copied to clipboard
fun mac(algorithm: Algorithm, key: ByteArray, message: ByteArray): ByteArray

Message authentication code function.

Link copied to clipboard
fun sign(key: EcPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): EcSignature

Signs data with a key.