Key

expect sealed class Key(source)

Base abstraction for Public/Private keys used by tor.

Inheritors

actual sealed class Key : Key(source)

Inheritors

actual sealed class Key(source)

Inheritors

Types

Link copied to clipboard
expect sealed class Private(key: ByteArray) : Key, Destroyable
actual sealed class Private(key: ByteArray) : Key, Destroyable, PrivateKey
actual sealed class Private(key: ByteArray) : Key, Destroyable
Link copied to clipboard
expect sealed class Public : Key
actual sealed class Public : Key, PublicKey
actual sealed class Public : Key

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

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 abstract 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 abstract fun base16CharsOrNull(): CharArray?
actual abstract fun base16CharsOrNull(): CharArray?
Link copied to clipboard
expect abstract 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 abstract fun base16OrNull(): String?
actual abstract fun base16OrNull(): String?
Link copied to clipboard
expect abstract 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 abstract fun base32CharsOrNull(): CharArray?
actual abstract fun base32CharsOrNull(): CharArray?
Link copied to clipboard
expect abstract 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 abstract fun base32OrNull(): String?
actual abstract fun base32OrNull(): String?
Link copied to clipboard
expect abstract 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 abstract fun base64CharsOrNull(): CharArray?
actual abstract fun base64CharsOrNull(): CharArray?
Link copied to clipboard
expect abstract 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 abstract fun base64OrNull(): String?
actual abstract fun base64OrNull(): String?
Link copied to clipboard
expect abstract 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 abstract fun encodedOrNull(): ByteArray?
actual abstract 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