Class HTTPXMLDsig

java.lang.Object
com.altova.raptorxml.HTTPXMLDsig
All Implemented Interfaces:
XMLDsig

public class HTTPXMLDsig extends Object
  • Constructor Details

    • HTTPXMLDsig

      public HTTPXMLDsig(com.altova.raptorxml.HTTPConnection connection, com.altova.raptorxml.AbstractRaptorXMLFactory parent)
  • Method Details

    • executeSign

      public boolean executeSign(String strResultOutputFileName, String strSignatureType, String strSignatureCanonicalizationMethod) throws RaptorXMLException
      Description copied from interface: XMLDsig
      Execute the sign command. It takes an XML document as input and creates an XML signature output document using the specified signing options. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Specified by:
      executeSign in interface XMLDsig
      Parameters:
      strResultOutputFileName - Location of the result output file
      strSignatureType - Specifies the type of signature to be generated. (Examples: detached, enveloping, enveloped)
      strSignatureCanonicalizationMethod - Specifies the canonicalization algorithm applied to the SignedInfo element. (Examples: xml-c14n11, REC-xml-c14n - 20010315, ...)
      Returns:
      true on success, false on failure. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Throws:
      RaptorXMLException
    • executeVerify

      public boolean executeVerify() throws RaptorXMLException
      Description copied from interface: XMLDsig
      Execute the verify command. It verifies the XML signature of the input file. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Specified by:
      executeVerify in interface XMLDsig
      Returns:
      true on success, false on failure. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Throws:
      RaptorXMLException
    • executeUpdate

      public boolean executeUpdate(String strResultOutputFileName) throws RaptorXMLException
      Description copied from interface: XMLDsig
      Execute the update command. It updates the XML signature in the signed input file. If the document has been modified, the XML signature will be different; otherwise, the updated signature will be the same as the previous signature. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Specified by:
      executeUpdate in interface XMLDsig
      Parameters:
      strResultOutputFileName - Location of the result output file
      Returns:
      true on success, false on failure. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Throws:
      RaptorXMLException
    • executeRemove

      public boolean executeRemove(String strResultOutputFileName) throws RaptorXMLException
      Description copied from interface: XMLDsig
      Execute the remove command. It removes the XML signature of the signed input file, and saves the resulting unsigned document to an output location that you specify. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Specified by:
      executeRemove in interface XMLDsig
      Returns:
      true on success, false on failure. In case of an error, use function XMLDsig.getLastErrorMessage() to get additional information.
      Throws:
      RaptorXMLException
    • setInputFileName

      public void setInputFileName(String filePath)
      Description copied from interface: XMLDsig
      Set the file name for the input XML data. Please note that you have to use absolute URLs.
      Specified by:
      setInputFileName in interface XMLDsig
      Parameters:
      filePath - an absolute URL giving the base location of the XML data.
    • setHMACSecretKey

      public void setHMACSecretKey(String strSecretKey)
      Description copied from interface: XMLDsig
      Set the HMAC shared secret key; must have a minimum length of six characters.
      Specified by:
      setHMACSecretKey in interface XMLDsig
      Parameters:
      strSecretKey - the HMAC shared secret key string.
    • setSignatureMethod

      public void setSignatureMethod(String strSignatureMethod)
      Description copied from interface: XMLDsig
      Set the signature-method; Specifies the algorithm to use for generating the signatur. If a certificate is specified, than signature-method is optional and the value for this parameter is derived from the certificate. When specified, it must match the algorithm used by the certificate. Example: rsa-sha256 When hmac-secret-key is used, then this option is mandatory. The value must be one of the supported HMAC algorithms: hmac-sha256, hmac-sha386, hmac-sha512, hmac-sha1 (discoureged by the specification)
      Specified by:
      setSignatureMethod in interface XMLDsig
    • setAbsoluteReferenceUri

      public void setAbsoluteReferenceUri(boolean boAbsolute)
      Description copied from interface: XMLDsig
      Specifies whether the URI of the signed document is to be read as absolute (true) or relative (false). Default is false.
      Specified by:
      setAbsoluteReferenceUri in interface XMLDsig
    • setCertificateName

      public void setCertificateName(String strCertName)
      Description copied from interface: XMLDsig
      The name of the certificate used for signing. Can't be used with --hmac-secret-key. [Windows: name of certificate in certificate-store, linux / macos: name of .PEM certificate file with private key.]
      Specified by:
      setCertificateName in interface XMLDsig
      Parameters:
      strCertName - the certname string
    • setCertificateStore

      public void setCertificateStore(String strCertStore)
      Description copied from interface: XMLDsig
      Certificate store that contains the certificate used for signing. [Windows only, mandatory when certificate-name is specified.]
      Specified by:
      setCertificateStore in interface XMLDsig
      Parameters:
      strCertStore - the certstore string
    • setDigestMethod

      public void setDigestMethod(String strDigestMethod)
      Description copied from interface: XMLDsig
      DigestMethod Algorithm used to compute the digest value over the input. [default: sha256]
      Specified by:
      setDigestMethod in interface XMLDsig
    • setHMACOutputLength

      public void setHMACOutputLength(int length)
      Description copied from interface: XMLDsig
      Truncate the output of the HMAC algorithm to length. (multiple of 8, only in conjunction with --hmac-secret-key.)
      Specified by:
      setHMACOutputLength in interface XMLDsig
    • setAppendKeyInfo

      public void setAppendKeyInfo(boolean boAppend)
      Description copied from interface: XMLDsig
      Append KeyInfo element to signature. [default: false]
      Specified by:
      setAppendKeyInfo in interface XMLDsig
    • setTransforms

      public void setTransforms(String strTransforms)
      Description copied from interface: XMLDsig
      XML Signature transformations applied to the input. (Examples: xml-c14n11, base64, strip-whitespaces)
      Specified by:
      setTransforms in interface XMLDsig
    • setWriteDefaultAttributes

      public void setWriteDefaultAttributes(boolean boDefaultAttributes)
      Description copied from interface: XMLDsig
      Include attribute values defaulted from DTD in signed document. [default: false]
      Specified by:
      setWriteDefaultAttributes in interface XMLDsig
    • toJSONMap

      public com.altova.raptorxml.JSONMap toJSONMap() throws RaptorXMLException
      Throws:
      RaptorXMLException
    • getLastErrorMessage

      public String getLastErrorMessage()
    • getMainOutput

      public String getMainOutput()
    • getAdditionalOutputs

      public String getAdditionalOutputs()