Class SignatureSpec

java.lang.Object
net.visma.autopay.http.signature.SignatureSpec

public class SignatureSpec extends Object
Signature specification - all data needed to create a signature.
  • Signature parameters
  • Signature component definitions
  • Signature context containing values for defined components. Copied from signed request or response.
  • Private key
  • Signature label
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder class to build SignatureSpec objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a builder used to construct SignatureSpec object
    boolean
    Compares the specified object with this SignatureSpec for equality.
    int
    Returns hash code for this SignatureSpec, which is composed of hash codes of all object fields
    Computes the signature according to this Signature Specs and returns values to be copied to Signature-Input and Signature HTTP headers.
    String representation of this object.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • sign

      public SignatureResult sign() throws SignatureException
      Computes the signature according to this Signature Specs and returns values to be copied to Signature-Input and Signature HTTP headers.
      Returns:
      Signature result: values to be copied to Signature-Input and Signature headers, and signature base which could be used for logging or debugging
      Throws:
      SignatureException - Problems with signature calculation, e.g. missing or malformatted values in Signature Context, problems with the private key. For detailed reason call SignatureException.getErrorCode().
      See Also:
    • builder

      public static SignatureSpec.Builder builder()
      Returns a builder used to construct SignatureSpec object
      Returns:
      A SignatureSpec builder
    • toString

      public String toString()
      String representation of this object. It does not contain private key data.
      Overrides:
      toString in class Object
      Returns:
      String representation of this SignatureSpec
    • equals

      public boolean equals(Object o)
      Compares the specified object with this SignatureSpec for equality. Returns true if the given object is of the same class as this SignatureSpec, and all object fields are equal.
      Overrides:
      equals in class Object
      Parameters:
      o - Object to be compared with this SignatureSpec
      Returns:
      True is specified object is equal to this SignatureSpec
    • hashCode

      public int hashCode()
      Returns hash code for this SignatureSpec, which is composed of hash codes of all object fields
      Overrides:
      hashCode in class Object
      Returns:
      The hash code for this SignatureSpec