Class SignedInfo

All Implemented Interfaces:
Serializable, EbicsElement, EbicsRootElement

public class SignedInfo extends DefaultEbicsRootElement
A representation of the SignedInfo element performing signature for signed ebics requests
Author:
hachani
See Also:
  • Constructor Details

    • SignedInfo

      public SignedInfo(EbicsUser user, byte[] digest)
      Constructs a new SignedInfo element
      Parameters:
      digest - the digest value
  • Method Details

    • build

      public void build() throws EbicsException
      Description copied from interface: EbicsElement
      Builds the EbicsElement XML fragment
      Throws:
      EbicsException
    • getDigest

      public byte[] getDigest()
      Returns the digest value.
      Returns:
      the digest value.
    • getSignatureType

      public SignatureType getSignatureType()
      Returns the signed info element as an XmlObject
      Returns:
      he signed info element
    • sign

      public byte[] sign(byte[] toSign) throws EbicsException
      Canonizes and signs a given input with the authentication private key. of the EBICS user.

      The given input to be signed is first Canonized using the http://www.w3.org/TR/2001/REC-xml-c14n-20010315 algorithm.

      The element to be canonized is only the SignedInfo element that should be contained in the request to be signed. Otherwise, a TransformationException is thrown.

      The namespace of the SignedInfo element should be named ds as specified in the EBICS specification for common namespaces nomination.

      The signature is ensured using the user X002 private key. This step is done in authenticate.

      Parameters:
      toSign - the input to sign
      Returns:
      the signed input
      Throws:
      EbicsException - signature fails.
    • toByteArray

      public byte[] toByteArray()
      Description copied from interface: EbicsRootElement
      Converts the EbicsElement to a byte array
      Specified by:
      toByteArray in interface EbicsRootElement
      Overrides:
      toByteArray in class DefaultEbicsRootElement
      Returns:
      the equivalent byte array of this EbicsElement
    • getName

      public String getName()
      Description copied from interface: EbicsElement
      Returns the name of this EbicsElement
      Returns:
      the name of the element