http_message_signatures/params

Signature parameters (RFC 9421 §2.3, §4.1): the covered components plus keyid, alg, created, and expires.

Types

pub type FromElementError {
  NotAnInnerList
  InvalidComponentIdentifier
  MissingKeyId
  MissingAlgorithm
}

Constructors

  • NotAnInnerList
  • InvalidComponentIdentifier
  • MissingKeyId
  • MissingAlgorithm
pub type SignatureParams {
  SignatureParams(
    components: List(component.ComponentIdentifier),
    key_id: String,
    algorithm: String,
    created: option.Option(Int),
    expires: option.Option(Int),
  )
}

Constructors

Values

pub fn from_element(
  element: types.Element,
) -> Result(SignatureParams, FromElementError)

Parses signature parameters back from their InnerList element. Fails closed: any unrecognized structure (unknown derived component name, a component identifier carrying unsupported parameters, a missing keyid or alg, …) is a parse error rather than a best-effort partial parse.

pub fn to_element(params: SignatureParams) -> types.Element

Serializes signature parameters to the InnerList Structured Fields Element used both as the @signature-params signature-base line value and as the value stored under the label in Signature-Input.

Search Document