Class SignatureBaseLine

java.lang.Object
com.authlete.hms.SignatureBaseLine

public class SignatureBaseLine extends Object
A class representing signature-base-line defined in RFC 9421 HTTP Message Signatures, Section 2.5. Creating the Signature Base.
See Also:
  • Constructor Details

    • SignatureBaseLine

      public SignatureBaseLine(ComponentIdentifier identifier, String value)
      A constructor with a component identifier and a component value.
      Parameters:
      identifier - A component identifier.
      value - A component value. This should not be null when the identifier refers to a derived component.
      Throws:
      IllegalArgumentException - The identifier is null.
  • Method Details

    • toString

      public String toString()
      Get the string representation of this instance, which is the serialized signature base line returned by the serialize() method.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this instance.
    • serialize

      public String serialize()
      Serialize the signature base line represented by this instance, and return the resulting string.
      Returns:
      The serialized signature base line represented by this instance.
    • serializeTo

      public StringBuilder serializeTo(StringBuilder sb)
      Serialize the signature base line represented by this instance, and write the resulting string into the specified string builder.

      The ABNF for signature base line from RFC 9421 HTTP Message Signatures, 2.5. Creating the Signature Base:

       signature-base-line = component-identifier ":" SP
           ( derived-component-value / *field-content )
           ; no obs-fold nor obs-text
       
      Parameters:
      sb - A string builder into which the resulting string is written.
      Returns:
      The same string builder that was passed as the argument.
    • getComponentIdentifier

      public ComponentIdentifier getComponentIdentifier()
      Get the component identifier.
      Returns:
      The component identifier.
    • getComponentValue

      public String getComponentValue()
      Get the component value.
      Returns:
      The component value.