ApiKey

An ApiKey consists of 2 parts, its data and signature. The signature is specific to the data and RSA key such that if it or the signature are modified, the ApiKey is invalidated.

The signature is always verified upon instantiation of ApiKey; a valid signature for data must be provided to instantiate ApiKey.

See also

Constructors

Link copied to clipboard
protected constructor(encodedApiKey: String, publicKey: String, decoder: ApiKey.Property.Decoder<P>)

Instantiates a new ApiKey instance, verifying the associated RSASignature within provided encodedApiKey, using the provided RSAKey.Public. Data is subsequently reconstructed from encodedApiKey.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
abstract class Property(val encoding: String)

Abstraction for modeling type-safe properties of the ApiKey implementation.

Properties

Link copied to clipboard
@JvmField
val data: ApiKey.Data<P>

The Data associated with this ApiKey

Functions

Link copied to clipboard
fun encoded(): String

Encodes the ApiKey by concatenating its encoded Data bytes that are base64 encoded, with the base64 encoding of its associated RSASignature, separated by a delimiter character of :.

Link copied to clipboard
fun signature(): String

The Base64 encoded RSASignature for the SHA3_256 hash value of data using signature algorithm NoneWithRSA.