Package-level declarations

Types

Link copied to clipboard
@Serializable
data class ClientStatus(val status: JsonObject, val expiration: Instant)
Link copied to clipboard
@Serializable
data class ConfirmationClaim(val jsonWebKey: JsonWebKey? = null, val encryptedSymmetricKey: JweEncrypted? = null, val keyId: String? = null, val jsonWebKeySetUrl: String? = null, val jsonWebKeyThumbprint: String? = null)

Structure to declare posession of a particular proof-of-possesion key, to be included in JsonWebToken.confirmationClaim

Link copied to clipboard
@Serializable
data class EudiWalletInfo(val generalInfo: GeneralInfo? = null, val keyStorageInfo: KeyStorageInfo? = null)

Data class containing information for instance/unit attestation which are not part of the OID4VCI specification. See https://github.com/eu-digital-identity-wallet/eudi-doc-standards-and-technical-specifications/blob/main/docs/technical-specifications/ts3-wallet-unit-attestation.md

Link copied to clipboard
@Serializable
data class GeneralInfo(val walletProviderName: String, val walletSolutionId: String, val walletSolutionVersion: String, val walletSolutionCertificationInformation: String)

Data class specifying general information on the wallet unit See https://github.com/eu-digital-identity-wallet/eudi-doc-standards-and-technical-specifications/blob/main/docs/technical-specifications/ts3-wallet-unit-attestation.md

Link copied to clipboard
@Serializable(with = JwaSerializer::class)
interface JsonWebAlgorithm : Enumerable
Link copied to clipboard
@Serializable
data class JsonWebKey(val algorithm: JsonWebAlgorithm? = null, val curve: ECCurve? = null, val e: ByteArray? = null, val k: ByteArray? = null, val keyOperations: Set<String>? = null, val keyId: String? = null, val type: JwkType? = null, val n: ByteArray? = null, val publicKeyUse: String? = null, val x: ByteArray? = null, val certificateChain: CertificateChain? = null, val certificateSha1Thumbprint: ByteArray? = null, val certificateUrl: String? = null, val certificateSha256Thumbprint: ByteArray? = null, val y: ByteArray? = null) : SpecializedCryptoPublicKey, SpecializedSymmetricKey

JSON Web Key as per RFC 7517.

Link copied to clipboard
@Serializable
data class JsonWebKeySet(val keys: Collection<JsonWebKey>)

JSON Web Key Set as per RFC 7517

Link copied to clipboard
@Serializable
data class JsonWebToken(val issuer: String? = null, val subject: String? = null, val audience: String? = null, val nonce: String? = null, val notBefore: Instant? = null, val issuedAt: Instant? = null, val expiration: Instant? = null, val jwtId: String? = null, val confirmationClaim: ConfirmationClaim? = null, val httpMethod: String? = null, val httpTargetUrl: String? = null, val accessTokenHash: String? = null, val walletName: String? = null, val walletLink: String? = null, val walletVersion: String? = null, val walletSolutionCertificationInformation: String? = null, val clientStatus: ClientStatus? = null, val eudiWalletInfo: EudiWalletInfo? = null, val status: JsonObject? = null)

Content of a JWT (JsonWebToken), with many optional keys, since no claim is strongly required.

Link copied to clipboard
object JwaSerializer : KSerializer<JsonWebAlgorithm>
Link copied to clipboard
Link copied to clipboard
object JweAlgorithmSerializer : KSerializer<JweAlgorithm>
Link copied to clipboard
data class JweDecrypted<T : Any>(val header: JweHeader, val payload: T)

Representation of a decrypted JSON Web Encryption object, i.e. header and payload.

Link copied to clipboard
data class JweEncrypted(val header: JweHeader, val headerAsParsed: ByteArray, val encryptedKey: ByteArray? = null, val iv: ByteArray, val ciphertext: ByteArray, val authTag: ByteArray)

Representation of an encrypted JSON Web Encryption object, consisting of its 5 parts: Header, encrypted key, IV, ciphertext, authentication tag.

Link copied to clipboard
object JweEncryptedSerializer : KSerializer<JweEncrypted>
Link copied to clipboard

Supported JWE algorithms.

Link copied to clipboard
object JweEncryptionSerializer : KSerializer<JweEncryption?>
Link copied to clipboard
@Serializable
data class JweHeader(val algorithm: JweAlgorithm?, val encryption: JweEncryption?, val keyId: String? = null, val type: String? = null, val contentType: String? = null, val notBefore: Instant? = null, val issuedAt: Instant? = null, val expiration: Instant? = null, val jwtId: String? = null, val jsonWebKey: JsonWebKey? = null, val jsonWebKeyUrl: String? = null, val ephemeralKeyPair: JsonWebKey? = null, val agreementPartyUInfo: ByteArray? = null, val agreementPartyVInfo: ByteArray? = null, val initializationVector: ByteArray? = null, val authenticationTag: ByteArray? = null, val certificateUrl: String? = null, val certificateChain: CertificateChain? = null, val certificateSha1Thumbprint: ByteArray? = null, val certificateSha256Thumbprint: ByteArray? = null)

Header of a JweEncrypted or JweDecrypted.

Link copied to clipboard
@Serializable(with = JwkTypeSerializer::class)
enum JwkType : Enum<JwkType>

Supported JSON Web Key types.

Link copied to clipboard
object JwkTypeSerializer : KSerializer<JwkType?>
Link copied to clipboard
@Serializable(with = JWS.JwsSerializer::class)
sealed class JWS

Wrapper for all JWS formats.

Link copied to clipboard

Since we support only JWS algorithms (with one exception), this class is called what it's called.

Link copied to clipboard
object JwsAlgorithmSerializer : KSerializer<JwsAlgorithm>
Link copied to clipboard
data class JwsCompact : JWS

Implements compact serialization as defined in RFC 7515

Link copied to clipboard
object JwsCompactStringSerializer : KSerializer<JwsCompact>

Serializes a JwsCompact as its compact JWS string form inside JSON.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Serializable
data class JwsFlattened : JWS

Flattened JSON JWS serialization.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class JwsGeneral : JWS

General JSON JWS.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class JwsHeader(val keyId: String? = null, val type: String? = null, val algorithm: JwsAlgorithm, val contentType: String? = null, val certificateChain: CertificateChain? = null, val notBefore: Instant? = null, val issuedAt: Instant? = null, val expiration: Instant? = null, val jsonWebKey: JsonWebKey? = null, val jsonWebKeySetUrl: String? = null, val certificateUrl: String? = null, val certificateSha1Thumbprint: ByteArray? = null, val certificateSha256Thumbprint: ByteArray? = null, val attestationJwt: JwsCompact? = null, val keyAttestation: JwsCompact? = null, val vcTypeMetadata: Set<String>? = null, val clientId: String? = null)

Effective JWS header as defined in RFC 7515 after combining protected and unprotected header members.

Link copied to clipboard
data class JwsSigned<out P : Any>(val header: JwsHeader, val payload: P, val signature: CryptoSignature.RawByteEncodable, val plainSignatureInput: ByteArray)

Representation of a signed JSON Web Signature object, i.e. consisting of header, payload and signature.

Link copied to clipboard
data class JwsTyped<out J : JWS, out P>(val jws: J, val payload: P)

Wrapper for at.asitplus.signum.indispensable.josef.JWS. Useful when payload type is known as part of the contract. All communication over the wire should use jws only!

Link copied to clipboard
@Serializable
data class KeyAttestationJwt(val issuer: String? = null, val subject: String? = null, val audience: String? = null, val nonce: String? = null, val notBefore: Instant? = null, val issuedAt: Instant, val expiration: Instant? = null, val eudiWalletInfo: EudiWalletInfo? = null, val attestedKeys: Collection<JsonWebKey>, val keyStorage: Collection<String>? = null, val userAuthentication: Collection<String>? = null, val certification: String? = null, val keyStorageStatus: KeyStorageStatus? = null, val status: JsonObject? = null)

Content of a Key Attestation in JWT format, according to OpenID for Verifiable Credential Issuance

Link copied to clipboard
@Serializable
data class KeyStorageInfo(val storageType: String, val storageCertificationInformation: String)

Data class specifying information on the key storage containing the attested keys. See https://github.com/eu-digital-identity-wallet/eudi-doc-standards-and-technical-specifications/blob/main/docs/technical-specifications/ts3-wallet-unit-attestation.md

Link copied to clipboard
@Serializable
data class KeyStorageStatus(val status: JsonObject, val expiration: Instant)
Link copied to clipboard
@Serializable
data class SignatureElement

One signature entry of general JSON JWS serialization.

Properties

Link copied to clipboard
Link copied to clipboard
val SymmetricKey<*, *, *>.jsonWebKeyBytes: KmmResult<ByteArray>

converts a symmetric key to its JWE serializable form (i.e. a single bytearray)

Link copied to clipboard

Functions

Link copied to clipboard
fun CryptoPublicKey.toJsonWebKey(keyId: String? = this.jwkId): JsonWebKey

Converts a CryptoPublicKey to a JsonWebKey

fun SymmetricKey<*, *, *>.toJsonWebKey(keyId: String? = this.jwkId): KmmResult<JsonWebKey>
fun SymmetricKey<*, *, *>.toJsonWebKey(keyId: String? = this.jwkId, vararg includedOps: String): KmmResult<JsonWebKey>

Converts this symmetric key to a JsonWebKey. algorithm may be null for algorithms, which do not directly correspond to a valid JWA alg identifier but will still be encoded.

Link copied to clipboard

Tries to map this algorithm to a matching JsonWebAlgorithm for key wrapping. Mappings exist for the following algorithms (as others are not direct mappings of symmetric algorithms):

Link copied to clipboard

Tries to find a matching JWS algorithm. Note that JWS imposes curve restrictions on ECDSA based on the digest.

Tries to find a matching JWS algorithm

Tries to find a matching JWS algorithm.

Link copied to clipboard

Converts flattened JSON serialization to compact serialization.

Link copied to clipboard

Converts compact serialization to the equivalent flattened JSON form.

Expands general JSON JWS representation into one flattened JWS per signature.

Link copied to clipboard

Converts multiple flattened JWS values with the same payload into general JSON JWS representation.

Link copied to clipboard

Converts the effective header into a single JwsHeader.Part.

Link copied to clipboard
inline fun <P, J : JWS> J.typed(): JwsTyped<J, P>