RandomSecretGenerator

class RandomSecretGenerator

Generator to create a secure random secret via SecureRandom.

Constructors

Link copied to clipboard
fun RandomSecretGenerator()

Functions

Link copied to clipboard
fun createRandomSecret(hmacAlgorithm: HmacAlgorithm): ByteArray

Generates a secure random secret with the same length as a hash of the given HMAC algorithm (defined in HmacAlgorithm.hashBytes).

fun createRandomSecret(secretBytes: Int): ByteArray

Generates a secure random secret with variable length.