Package com.helger.as2lib.util
Class AS2Helper
java.lang.Object
com.helger.as2lib.util.AS2Helper
-
Method Summary
Modifier and TypeMethodDescriptionstatic IMessageMDN
createMDN
(IAS2Session aSession, AS2Message aMsg, DispositionType aDisposition, String sText) Create a new MDNstatic void
createMDNData
(IAS2Session aSession, IMessageMDN aMdn, boolean bSignMDN, boolean bIncludeCertificateInSignedContent, ECryptoAlgorithmSign eMICAlg, boolean bUseOldRFC3851MicAlgs, boolean bRemoveCmsAlgorithmProtect) Create and fill the MDN parameterstatic ICryptoHelper
static String
static void
parseMDN
(IMessage aMsg, X509Certificate aReceiverCert, boolean bUseCertificateInBodyPart, Consumer<? super X509Certificate> aEffectiveCertificateConsumer, AS2ResourceHelper aResHelper)
-
Method Details
-
getCryptoHelper
-
createMDNData
public static void createMDNData(@Nonnull IAS2Session aSession, @Nonnull IMessageMDN aMdn, boolean bSignMDN, boolean bIncludeCertificateInSignedContent, @Nullable ECryptoAlgorithmSign eMICAlg, boolean bUseOldRFC3851MicAlgs, boolean bRemoveCmsAlgorithmProtect) throws Exception Create and fill the MDN parameter- Parameters:
aSession
- Session to retrieve the certificate factory for signingaMdn
- The MDN object to be filledbSignMDN
-true
to sign the MDNbIncludeCertificateInSignedContent
-true
if the passed certificate should be part of the signed content,false
if the certificate should not be put in the content. E.g. for PEPPOL this must betrue
.eMICAlg
- The MIC algorithm to be used. Must be present if bSignMDN istrue
.bUseOldRFC3851MicAlgs
-true
to use the old RFC 3851 MIC algorithm names (e.g.sha1
),false
to use the new RFC 5751 MIC algorithm names (e.g.sha-1
).bRemoveCmsAlgorithmProtect
- iftrue
, the CMS attribute "AlgorithmProtect" will be removed. This is needed in compatibility with e.g. IBM Sterling. Default value should befalse
. Since 4.10.1. See Issue #137.- Throws:
Exception
- In case something internally goes wrong
-
createMDN
@Nonnull public static IMessageMDN createMDN(@Nonnull IAS2Session aSession, @Nonnull AS2Message aMsg, @Nonnull DispositionType aDisposition, @Nonnull String sText) throws Exception Create a new MDN- Parameters:
aSession
- AS2 session to be used. May not benull
.aMsg
- The source AS2 message for which the MDN is to be created. May not benull
.aDisposition
- The disposition - either success or error. May not benull
.sText
- The text to be send. May not benull
.- Returns:
- The created MDN object which is already attached to the passed source AS2 message.
- Throws:
Exception
- In case of an error
-
parseMDN
public static void parseMDN(@Nonnull IMessage aMsg, @Nullable X509Certificate aReceiverCert, boolean bUseCertificateInBodyPart, @Nullable Consumer<? super X509Certificate> aEffectiveCertificateConsumer, @Nonnull AS2ResourceHelper aResHelper) throws Exception - Throws:
Exception
-
getWithoutSpaces
-