Package com.helger.phase4.dump
Class AS4DumpReader
java.lang.Object
com.helger.phase4.dump.AS4DumpReader
Utility method to read dump files later.
- Since:
- 1.3.1
- Author:
- Philip Helger
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddecryptAS4In(byte[] aAS4InData, IAS4CryptoFactory aCryptoFactorySign, IAS4CryptoFactory aCryptoFactoryCrypt, Consumer<com.helger.commons.http.HttpHeaderMap> aHttpHeaderConsumer, AS4DumpReader.IDecryptedPayloadConsumer aDecryptedConsumer) 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 ;-)static voiddecryptAS4In(byte[] aAS4InData, IAS4CryptoFactory aCryptoFactory, Consumer<com.helger.commons.http.HttpHeaderMap> aHttpHeaderConsumer, AS4DumpReader.IDecryptedPayloadConsumer aDecryptedConsumer) Deprecated, for removal: This API element is subject to removal in a future version.static voidreadAndSkipInitialHttpHeaders(byte[] aAS4InData, Consumer<com.helger.commons.http.HttpHeaderMap> aHttpHeaderConsumer, IntConsumer aHttpEndIndexConsumer) Utility method to just read and consume the leading HTTP headers from a dump.
-
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 bydecryptAS4In(byte[], IAS4CryptoFactory, IAS4CryptoFactory, Consumer, IDecryptedPayloadConsumer)- Parameters:
aAS4InData- The byte array with the dump. May not benull.aHttpHeaderConsumer- The optional consumer for the read HTTP headers. May benull.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 benull.- Since:
- 2.1.0
-
decryptAS4In
@Deprecated(forRemoval=true, since="2.2.0") public static void decryptAS4In(@Nonnull byte[] aAS4InData, @Nonnull IAS4CryptoFactory aCryptoFactory, @Nullable Consumer<com.helger.commons.http.HttpHeaderMap> aHttpHeaderConsumer, @Nonnull AS4DumpReader.IDecryptedPayloadConsumer aDecryptedConsumer) throws org.apache.wss4j.common.ext.WSSecurityException, Phase4Exception, IOException, jakarta.mail.MessagingException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.apache.wss4j.common.ext.WSSecurityExceptionPhase4ExceptionIOExceptionjakarta.mail.MessagingException
-
decryptAS4In
public static void decryptAS4In(@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:
aAS4InData- The byte array with the dumped data.aCryptoFactorySign- The Crypto factory to be used. May not benull.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 benull.aHttpHeaderConsumer- An optional HTTP Header map consumer. May benull.aDecryptedConsumer- The consumer for the decrypted payload - whatever that is :). May not benull.- Throws:
org.apache.wss4j.common.ext.WSSecurityException- In case of errorPhase4Exception- In case of errorIOException- In case of errorjakarta.mail.MessagingException- In case of error
-