of

fun of(bytes: ByteArray): Key

Copies bytes into a new key.


fun of(text: String): Key

Encodes text as UTF-8.

Throws

if text holds an unpaired surrogate. Such a string has no UTF-8 encoding, and substituting a replacement character — which String.toByteArray does silently — would store a key the caller never asked for and then fail to find it again.