Back to Exposed

Package-level declarations

docs/api/exposed-crypt/org.jetbrains.exposed.v1.crypt/index.html

1.5.012.3 KB
Original Source

Package-level declarations

TypesFunctions

Types

Algorithms

Link copied to clipboard

object Algorithms

Symmetric-key block ciphers for performing encryption and decryption.

Argon2Hasher

Link copied to clipboard

class Argon2Hasher(saltLength: Int = DEFAULT_SALT_LENGTH, hashLength: Int = DEFAULT_HASH_LENGTH, parallelism: Int = DEFAULT_PARALLELISM, memory: Int = DEFAULT_MEMORY, iterations: Int = DEFAULT_ITERATIONS) : PasswordEncoderHasher

Hasher that uses the Argon2id algorithm, the first choice recommended by OWASP, salting each value individually.

BCryptHasher

Link copied to clipboard

class BCryptHasher(strength: Int = DEFAULT_STRENGTH) : PasswordEncoderHasher

Hasher that uses the bcrypt algorithm, salting each value individually.

ByteArrayEncryptionTransformer

Link copied to clipboard

class ByteArrayEncryptionTransformer(encryptor: Encryptor) : ColumnTransformer<ByteArray, ByteArray>

EncryptedBinaryColumnType

Link copied to clipboard

class EncryptedBinaryColumnType(encryptor: Encryptor, length: Int) : ColumnWithTransform<ByteArray, ByteArray>

Binary column for storing encrypted binary strings of a specific length, using the provided encryptor.

EncryptedVarCharColumnType

Link copied to clipboard

class EncryptedVarCharColumnType(encryptor: Encryptor, colLength: Int) : ColumnWithTransform<String, String>

Character column for storing encrypted strings, using the provided encryptor, with the specified maximum colLength.

Encryptor

Link copied to clipboard

class Encryptor(val encryptFn: (String) -> String, val decryptFn: (String) -> String, val maxColLengthFn: (Int) -> Int)

Base cipher class responsible for the encryption and decryption of data.

Hashed

Link copied to clipboard

class Hashed(hasher: Hasher, val encodedValue: String)

A hashed column holds these rather than strings, which is what keeps a plaintext value from being stored in one by accident, or compared against one in SQL. Assigning a Hashed read from the database back to a column stores it unchanged, without hashing it a second time.

Hasher

Link copied to clipboard

interface Hasher

Base class responsible for the one-way hashing of data.

HashingTransformer

Link copied to clipboard

class HashingTransformer(val hasher: Hasher) : ColumnTransformer<String, Hashed>

Transformer that stores the Hashed.encodedValue of a hashed value in a character column, using the provided hasher to verify the values read back out of it.

NullableHashingTransformer

Link copied to clipboard

class NullableHashingTransformer(val hasher: Hasher) : ColumnTransformer<String?, Hashed?>

Transformer that behaves like HashingTransformer but passes null through untouched, for use with nullable character columns.

PasswordEncoderHasher

Link copied to clipboard

open class PasswordEncoderHasher(passwordEncoder: PasswordEncoder) : Hasher

Hasher that delegates to a Spring Security passwordEncoder.

Pbkdf2Hasher

Link copied to clipboard

class Pbkdf2Hasher(secret: CharSequence = "", saltLength: Int = DEFAULT_SALT_LENGTH, iterations: Int = DEFAULT_ITERATIONS, algorithm: Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm = SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256) : PasswordEncoderHasher

Hasher that uses the PBKDF2 algorithm, salting each value individually.

SCryptHasher

Link copied to clipboard

class SCryptHasher(cpuCost: Int = DEFAULT_CPU_COST, memoryCost: Int = DEFAULT_MEMORY_COST, parallelization: Int = DEFAULT_PARALLELIZATION, keyLength: Int = DEFAULT_KEY_LENGTH, saltLength: Int = DEFAULT_SALT_LENGTH) : PasswordEncoderHasher

Hasher that uses the scrypt algorithm, salting each value individually.

StringEncryptionTransformer

Link copied to clipboard

class StringEncryptionTransformer(encryptor: Encryptor) : ColumnTransformer<String, String>

Functions

encryptedBinary

Link copied to clipboard

fun Table.encryptedBinary(name: String, cipherByteLength: Int, encryptor: Encryptor): Column<ByteArray>

Creates a binary column, with the specified name, for storing encrypted binary strings.

encryptedVarchar

Link copied to clipboard

fun Table.encryptedVarchar(name: String, cipherTextLength: Int, encryptor: Encryptor): Column<String>

Creates a character column, with the specified name, for storing encrypted strings.

hash

Link copied to clipboard

@JvmName(name = "hashNullable")

fun Column<Hashed?>.hash(plainText: String): Hashed

Hashes plainText with the Hasher this nullable column was declared with, ready to be stored in it.

fun Column<Hashed>.hash(plainText: String): Hashed

Hashes plainText with the Hasher this column was declared with, ready to be stored in it.

hashed

Link copied to clipboard

@JvmName(name = "hashedNullable")

fun Column<String?>.hashed(hasher: Hasher = BCryptHasher()): Column<Hashed?>

Transforms this nullable character column into one that stores one-way hashed values, using the provided hasher, and leaving null values untouched.

fun Column<String>.hashed(hasher: Hasher = BCryptHasher()): Column<Hashed>

Transforms this character column into one that stores one-way hashed values, using the provided hasher.

Generated by Dokka © 2026 Copyright