Class ExportUtilR17

java.lang.Object
com.aquima.interactions.ds.export.r17.ExportUtilR17

public final class ExportUtilR17 extends Object
Utility class for decrypting/encrypting and signing/validating of exports.
Since:
17.1
  • Method Details

    • createExportName

      public static String createExportName(String name, Version version, String prefix)
      Creates an export name that can be used as filename for an export.
      Parameters:
      name - the name of application/module
      version - the version of the application/module
      prefix - optional prefix (e.g. test)
      Returns:
      an exportname
    • encrypt

      public static void encrypt(Document document) throws IOException
      GZips and encrypts the data.

      Decrypt with decrypt(Document)

      Parameters:
      document - the document to encrypt
      Throws:
      CryptoGraphicException - when the data cannot be encrypted
      IOException - when the message cannot be gzipped
    • decrypt

      public static void decrypt(Document document)
      Decrypts and unzips the data and put it in an input stream.

      Encrypt with encrypt(Document)

      Parameters:
      document - the document to decrypt
      Throws:
      CryptoGraphicException - when the data cannot be encrypted
    • sign

      public static void sign(Document document, IResource privateKeyResource)
      Signs a document

      Validate with validate(Document)}

      Parameters:
      document - the document to sign
      privateKeyResource - the private key resource that is used for signing.
      Throws:
      CryptoGraphicException - when there the signature cannot be created.
    • validate

      public static SignatureValidationResult validate(Document xmlDocument)
      Validates the data with the specified signature.

      Sign with sign(Document, IResource)

      Parameters:
      xmlDocument - the document to validate a signature for
      Returns:
      an object that represents the result of the signature validation
      Throws:
      CryptoGraphicException - when the data is not valid with the signature