JwsFlattened

@Serializable
data class JwsFlattened : JWS(source)

Flattened JSON JWS serialization.

A flattened JWS carries one payload and one signature. The protected header is stored as encoded bytes in plainProtectedHeader; the optional unprotected header is represented as JwsHeader.Part. The effective jwsHeader is reconstructed by merging both fragments with JwsHeader.fromParts.

Either header fragment may be partial. Only the combination of protected and unprotected parameters must constitute a valid JwsHeader.

plainPayload stores the plain payload bytes. JSON serialization base64url-encodes those bytes for the payload member, so callers should not pre-encode them.

If plainPayload data structure is defined as part of the contact consider JwsFlattenedTyped

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@Transient
val jwsHeader: JwsHeader
Link copied to clipboard
@SerialName(value = "payload")
open override val plainPayload: ByteArray

Raw payload bytes.

Link copied to clipboard
@SerialName(value = "protected")
val plainProtectedHeader: ByteArray?
Link copied to clipboard
@SerialName(value = "signature")
val plainSignature: ByteArray
Link copied to clipboard
Link copied to clipboard
@Transient
val signatureInput: ByteArray
Link copied to clipboard
@SerialName(value = "header")
val unprotectedHeader: JwsHeader.Part?

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
inline fun <P> getPayload(serialFormat: SerialFormat = joseCompliantSerializer): KmmResult<P>

Find correct serializer at compile time

fun <P> getPayload(serializer: KSerializer<P>, serialFormat: SerialFormat = joseCompliantSerializer): KmmResult<P>
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Converts flattened JSON serialization to compact serialization.