Public

sealed class Public(key: ByteArray) : Key.Public(source)

Holder for a public key associated with a Hidden Service's client authentication configuration.

This would be the key a Hidden Service operator adds, to only allow connections from tor clients who have the AuthKey.Private associated with this AuthKey.Public.

See also

Inheritors

Constructors

Link copied to clipboard
protected constructor(key: ByteArray)

Functions

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

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

Link copied to clipboard
override fun base16(): String

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

Link copied to clipboard
override fun base16Chars(): CharArray

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

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.

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.

Link copied to clipboard
override fun base32(): String

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

Link copied to clipboard
override fun base32Chars(): CharArray

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

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.

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.

Link copied to clipboard
override fun base64(): String

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

Link copied to clipboard
override fun base64Chars(): CharArray

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

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.

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.

Link copied to clipboard
fun descriptorBase32(): String

Produces the descriptor String using the Base32 encoding of the key in the form of descriptor:{algorithm}:{base32 encoded key}.

Link copied to clipboard
fun descriptorBase32Utf8(): ByteArray

Produces the descriptor using the Base32 encoding of the key in the form of descriptor:{algorithm}:{base32 encoded key} as UTF-8 bytes.

Link copied to clipboard
fun descriptorBase64(): String

Produces the descriptor String using the Base64 encoding of the key in the form of descriptor:{algorithm}:{base64 encoded key}.

Link copied to clipboard
fun descriptorBase64Utf8(): ByteArray

Produces the descriptor using the Base64 encoding of the key in the form of descriptor:{algorithm}:{base64 encoded key} as UTF-8 bytes.

Link copied to clipboard
override fun encoded(): ByteArray

Returns the key in its primary encoding.

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.