Private

expect sealed class Private(key: ByteArray) : Key, Destroyable(source)

Inheritors

actual sealed class Private(key: ByteArray) : Key, Destroyable, PrivateKey(source)
actual sealed class Private(key: ByteArray) : Key, Destroyable(source)

Constructors

Link copied to clipboard
protected expect constructor(key: ByteArray)
protected actual constructor(key: ByteArray)
protected actual constructor(key: ByteArray)

Properties

Link copied to clipboard
override val algorithm: String
Link copied to clipboard
override val encoded: ByteArray?
Link copied to clipboard
override val format: String
Link copied to clipboard
override val isDestroyed: Boolean

Functions

Link copied to clipboard
expect abstract fun algorithm(): String

Returns the algorithm name for this key. For example, ED25519-V3 or x25519

actual abstract fun algorithm(): String
Link copied to clipboard
expect fun base16(): String

Returns a Base16 (uppercase) encoded String of the raw key value.

actual fun base16(): String
actual fun base16(): String
Link copied to clipboard
expect fun base16Chars(): CharArray

Returns a Base16 (uppercase) encoded CharArray of the raw key value.

actual fun base16Chars(): CharArray
actual fun base16Chars(): CharArray
Link copied to clipboard
expect override fun base16CharsOrNull(): CharArray?

Returns a Base16 (uppercase) encoded CharArray of the raw key value, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun base16CharsOrNull(): CharArray?
actual override fun base16CharsOrNull(): CharArray?
Link copied to clipboard
expect override fun base16OrNull(): String?

Returns a Base16 (uppercase) encoded String of the raw key value, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun base16OrNull(): String?
actual override fun base16OrNull(): String?
Link copied to clipboard
expect fun base32(): String

Returns a Base32 (uppercase & no padding) encoded String of the raw key value.

actual fun base32(): String
actual fun base32(): String
Link copied to clipboard
expect fun base32Chars(): CharArray

Returns a Base32 (uppercase & no padding) encoded CharArray of the raw key value.

actual fun base32Chars(): CharArray
actual fun base32Chars(): CharArray
Link copied to clipboard
expect override fun base32CharsOrNull(): CharArray?

Returns a Base32 (uppercase & no padding) encoded CharArray of the raw key value, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun base32CharsOrNull(): CharArray?
actual override fun base32CharsOrNull(): CharArray?
Link copied to clipboard
expect override fun base32OrNull(): String?

Returns a Base32 (uppercase & no padding) encoded String of the raw key value, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun base32OrNull(): String?
actual override fun base32OrNull(): String?
Link copied to clipboard
expect fun base64(): String

Returns a Base64 (no padding) encoded String of the raw key value.

actual fun base64(): String
actual fun base64(): String
Link copied to clipboard
expect fun base64Chars(): CharArray

Returns a Base64 (no padding) encoded CharArray of the raw key value.

actual fun base64Chars(): CharArray
actual fun base64Chars(): CharArray
Link copied to clipboard
expect override fun base64CharsOrNull(): CharArray?

Returns a Base64 (no padding) encoded CharArray of the raw key value, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun base64CharsOrNull(): CharArray?
actual override fun base64CharsOrNull(): CharArray?
Link copied to clipboard
expect override fun base64OrNull(): String?

Returns a Base64 (no padding) encoded String of the raw key value, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun base64OrNull(): String?
actual override fun base64OrNull(): String?
Link copied to clipboard

Checks if a Destroyable instance has been destroyed or not.

Link copied to clipboard
expect override fun destroy()

Destroys the Key.Private, back-filling the underlying array with 0 bytes.

actual override fun destroy()
actual override fun destroy()
Link copied to clipboard
@JvmStatic
@JvmOverloads
fun Destroyable.destroyedException(namePrefix: String = ""): IllegalStateException

Creates an IllegalStateException with a default message of

Link copied to clipboard
expect fun encoded(): ByteArray

Returns the key in its primary encoding.

actual fun encoded(): ByteArray
actual fun encoded(): ByteArray
Link copied to clipboard
expect override fun encodedOrNull(): ByteArray?

Returns the key in its primary encoding, or null if the key does not support encoding or Key.Private.isDestroyed is true.

actual override fun encodedOrNull(): ByteArray?
actual override fun encodedOrNull(): ByteArray?
Link copied to clipboard
override fun getAlgorithm(): String
Link copied to clipboard
override fun getEncoded(): ByteArray?
Link copied to clipboard
override fun getFormat(): String
Link copied to clipboard
expect override fun isDestroyed(): Boolean
actual override fun isDestroyed(): Boolean