Class AS4DumpReader

java.lang.Object
com.helger.phase4.dump.AS4DumpReader

public final class AS4DumpReader extends Object
Utility method to read dump files later.
Since:
1.3.1
Author:
Philip Helger
  • Method Details

    • readAndSkipInitialHttpHeaders

      public static void readAndSkipInitialHttpHeaders(@Nonnull byte[] aAS4InData, @Nullable Consumer<com.helger.commons.http.HttpHeaderMap> aHttpHeaderConsumer, @Nullable IntConsumer aHttpEndIndexConsumer)
      Utility method to just read and consume the leading HTTP headers from a dump. Usually this method is not called explicitly but invoked directly by decryptAS4In(String, byte[], IAS4CryptoFactory, IAS4CryptoFactory, Consumer, IDecryptedPayloadConsumer)
      Parameters:
      aAS4InData - The byte array with the dump. May not be null.
      aHttpHeaderConsumer - The optional consumer for the read HTTP headers. May be null.
      aHttpEndIndexConsumer - An optional consumer for the number of header data bytes read, so that the start index of the payload can easily be determined. May be null.
      Since:
      2.1.0
    • decryptAS4In

      public static void decryptAS4In(@Nonnull @Nonempty String sAS4ProfileID, @Nonnull byte[] aAS4InData, @Nonnull IAS4CryptoFactory aCryptoFactorySign, @Nonnull IAS4CryptoFactory aCryptoFactoryCrypt, @Nullable Consumer<com.helger.commons.http.HttpHeaderMap> aHttpHeaderConsumer, @Nonnull AS4DumpReader.IDecryptedPayloadConsumer aDecryptedConsumer) throws org.apache.wss4j.common.ext.WSSecurityException, Phase4Exception, IOException, jakarta.mail.MessagingException
      Utility method to decrypt dumped .as4in message late.
      Note: this method was mainly created for internal use and does not win the prize for the most sexy piece of software in the world ;-)
      Parameters:
      sAS4ProfileID - The AS4 profile ID to use. May neither be null nor empty.
      aAS4InData - The byte array with the dumped data.
      aCryptoFactorySign - The Crypto factory to be used. May not be null.
      aCryptoFactoryCrypt - The Crypto factory to be used for decrypting. This crypto factory must use the private key that can be used to decrypt this particular message. May not be null.
      aHttpHeaderConsumer - An optional HTTP Header map consumer. May be null.
      aDecryptedConsumer - The consumer for the decrypted payload - whatever that is :). May not be null.
      Throws:
      org.apache.wss4j.common.ext.WSSecurityException - In case of error
      Phase4Exception - In case of error
      IOException - In case of error
      jakarta.mail.MessagingException - In case of error