Package com.helger.phase4.peppol.servlet
Class Phase4PeppolDefaultReceiverConfiguration
java.lang.Object
com.helger.phase4.peppol.servlet.Phase4PeppolDefaultReceiverConfiguration
This class contains the references values against which incoming values are compared. These are
the static default values that can be overridden in
See
Old name before v3:
Phase4PeppolServletMessageProcessorSPI. Please note that this class is not thread safe,
as the default values are not meant to be modified during runtime.See
Phase4PeppolReceiverConfiguration for the "per-request" version of this class.Old name before v3:
Phase4PeppolServletConfiguration- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final com.helger.security.certificate.TrustedCACheckerstatic final booleanstatic final com.helger.peppolid.factory.IIdentifierFactory -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable com.helger.security.certificate.TrustedCACheckerstatic @NonNull com.helger.base.state.ETriStatestatic @Nullable X509Certificatestatic @Nullable com.helger.security.revocation.ERevocationCheckModestatic @Nullable Stringstatic @NonNull Phase4PeppolReceiverConfigurationGet the statically configured data as aPhase4PeppolReceiverConfigurationinstance.Get the statically configured data as aPhase4PeppolReceiverConfiguration.Phase4PeppolReceiverConfigurationBuilderinstance.static @NonNull com.helger.peppolid.factory.IIdentifierFactorystatic @Nullable com.helger.peppol.sml.ISMLInfostatic @Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProviderstatic @Nullable com.helger.security.revocation.ERevocationCheckModestatic @NonNull com.helger.smpclient.url.ISMPURLProviderstatic booleanstatic booleanDeprecated, for removal: This API element is subject to removal in a future version.This is deprecated, because the feature is required for years, so there is no need anymore to disable this featurestatic booleanstatic booleanstatic booleanstatic booleanstatic voidsetAPCAChecker(@Nullable com.helger.security.certificate.TrustedCAChecker a) Set the Peppol CA checker to be used.static voidsetAPCacheRevocationCheckResult(@NonNull com.helger.base.state.ETriState e) Override the revocation result caching flag for the inbound signing certificate check.static voidsetAPCertificate(@Nullable X509Certificate aAPCertificate) Set the Peppol AP certificate to be used for comparing against the SMP lookup result.static voidsetAPRevocationCheckMode(@Nullable com.helger.security.revocation.ERevocationCheckMode e) Override the revocation check mode for the inbound signing certificate check.static voidsetAPRevocationSoftFail(boolean b) Set whether an undeterminable revocation status of the inbound AP signing certificate is accepted as valid (soft-fail) instead of being rejected.static voidsetAS4EndpointURL(@Nullable String sAS4EndpointURL) Set the expected endpoint URL to be used for comparing against the SMP lookup result.static voidsetCheckSBDHForMandatoryCountryC1(boolean b) Deprecated, for removal: This API element is subject to removal in a future version.This is deprecated, because the feature is required for years, so there is no need anymore to disable this featurestatic voidsetCheckSigningCertificateRevocation(boolean b) Set whether the signing certificate should be checked for revocation or not.static voidsetPerformSBDHValueChecks(boolean b) Enable or disable the SBDH value checks.static voidsetReceiverCheckEnabled(boolean bReceiverCheckEnabled) Enable or disable the overall receiver checks (check if a receiver is actually registered in the configured SMP with the configured AP URL).static voidsetSBDHIdentifierFactory(@NonNull com.helger.peppolid.factory.IIdentifierFactory a) Set the default identifier factory used to parse SBDH data.static voidsetSMLInfo(@Nullable com.helger.peppol.sml.ISMLInfo aSMLInfo) Set the SML information for dynamic per-participant SMP client resolution.static voidsetSMPClient(@Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider aSMPClient) Set the SMP client to use for reverse checking if the participant is registered or not.static voidsetSMPRevocationCheckMode(@Nullable com.helger.security.revocation.ERevocationCheckMode e) Set the revocation check mode to apply when verifying SMP response certificates.static voidsetSMPRevocationSoftFail(boolean b) Set whether an indeterminable revocation status of an SMP response certificate is accepted (soft-fail) or causes the certificate to be rejected.static voidsetSMPURLProvider(@NonNull com.helger.smpclient.url.ISMPURLProvider aSMPURLProvider) Set the SMP URL provider to be used for dynamic SMP client resolution.
-
Field Details
-
DEFAULT_RECEIVER_CHECK_ENABLED
public static final boolean DEFAULT_RECEIVER_CHECK_ENABLED- See Also:
-
DEFAULT_SBDH_IDENTIFIER_FACTORY
public static final com.helger.peppolid.factory.IIdentifierFactory DEFAULT_SBDH_IDENTIFIER_FACTORY -
DEFAULT_CHECK_SIGNING_CERTIFICATE_REVOCATION
public static final boolean DEFAULT_CHECK_SIGNING_CERTIFICATE_REVOCATION- See Also:
-
DEFAULT_PEPPOL_AP_CA_CHECKER
public static final com.helger.security.certificate.TrustedCAChecker DEFAULT_PEPPOL_AP_CA_CHECKER
-
-
Method Details
-
isReceiverCheckEnabled
public static boolean isReceiverCheckEnabled()- Returns:
trueif the checks for endpoint URL and endpoint certificate are enabled,falseotherwise. By default the checks are enabled.
-
setReceiverCheckEnabled
public static void setReceiverCheckEnabled(boolean bReceiverCheckEnabled) Enable or disable the overall receiver checks (check if a receiver is actually registered in the configured SMP with the configured AP URL). If the check is enabled, than all values MUST be set.- Parameters:
bReceiverCheckEnabled-trueto enable the checks,falseto disable them.- See Also:
-
getSMPClient
public static @Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider getSMPClient()- Returns:
- The SMP client object that should be used for the SMP lookup. It is customizable
because it depends either on the SML or a direct URL to the SMP may be provided. May be
nullif not yet configured.
-
setSMPClient
public static void setSMPClient(@Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider aSMPClient) Set the SMP client to use for reverse checking if the participant is registered or not. Since v4.4.2 this is an alternative to usingsetSMLInfo(ISMLInfo)for dynamic per-participant resolution.- Parameters:
aSMPClient- The SMP metadata provider to be used. May benull.- See Also:
-
getSMLInfo
public static @Nullable com.helger.peppol.sml.ISMLInfo getSMLInfo()- Returns:
- The SML information for dynamic SMP client resolution per participant ID. May be
nullif not yet configured. - Since:
- v4.4.2
- See Also:
-
setSMLInfo
public static void setSMLInfo(@Nullable com.helger.peppol.sml.ISMLInfo aSMLInfo) Set the SML information for dynamic per-participant SMP client resolution. This is an alternative to using a fixed SMP client viasetSMPClient(ISMPExtendedServiceMetadataProvider).- Parameters:
aSMLInfo- The SML info to use. May benull.- Since:
- v4.4.2
- See Also:
-
getSMPURLProvider
public static @NonNull com.helger.smpclient.url.ISMPURLProvider getSMPURLProvider()- Returns:
- The SMP URL provider to be used for dynamic SMP client resolution. Never
null. Defaults toPeppolNaptrURLProvider.INSTANCE. - Since:
- v4.4.2
-
setSMPURLProvider
public static void setSMPURLProvider(@NonNull com.helger.smpclient.url.ISMPURLProvider aSMPURLProvider) Set the SMP URL provider to be used for dynamic SMP client resolution. Only relevant ifsetSMLInfo(ISMLInfo)is set.- Parameters:
aSMPURLProvider- The SMP URL provider to use. May not benull.- Since:
- v4.4.2
-
getSMPRevocationCheckMode
public static @Nullable com.helger.security.revocation.ERevocationCheckMode getSMPRevocationCheckMode()- Returns:
- The revocation check mode to apply when verifying SMP response certificates.
nullmeans "use the JVM-wide default fromCertificateRevocationCheckerDefaults". - Since:
- 4.5.0
-
setSMPRevocationCheckMode
public static void setSMPRevocationCheckMode(@Nullable com.helger.security.revocation.ERevocationCheckMode e) Set the revocation check mode to apply when verifying SMP response certificates.- Parameters:
e- The revocation check mode to use.nullmeans "use the JVM-wide default fromCertificateRevocationCheckerDefaults".- Since:
- 4.5.0
-
isSMPRevocationSoftFail
public static boolean isSMPRevocationSoftFail()- Returns:
trueto accept an indeterminable revocation status of an SMP response certificate (soft-fail),falseto reject. Defaults toCertificateRevocationCheckerDefaults.isAllowSoftFail().- Since:
- 4.5.0
-
setSMPRevocationSoftFail
public static void setSMPRevocationSoftFail(boolean b) Set whether an indeterminable revocation status of an SMP response certificate is accepted (soft-fail) or causes the certificate to be rejected.- Parameters:
b-trueto accept on unknown revocation status (soft-fail),falseto reject.- Since:
- 4.5.0
-
getAS4EndpointURL
- Returns:
- The URL of this (my) AP to compare to against the SMP lookup result upon retrieval. Is
nullby default.
-
setAS4EndpointURL
Set the expected endpoint URL to be used for comparing against the SMP lookup result.- Parameters:
sAS4EndpointURL- The endpoint URL to check against. May benull.
-
getAPCertificate
- Returns:
- The certificate of this (my) AP to compare to against the SMP lookup result upon
retrieval. Is
nullby default.
-
setAPCertificate
Set the Peppol AP certificate to be used for comparing against the SMP lookup result.- Parameters:
aAPCertificate- The AP certificate to be used for compatibility. May benull.
-
getSBDHIdentifierFactory
@ChangeNextMajorRelease("Remove the \'SBDH\' from the name - it\'s used outside as well") public static @NonNull com.helger.peppolid.factory.IIdentifierFactory getSBDHIdentifierFactory()- Returns:
- The default identifier factory used to parse SBDH data. Never
null. - Since:
- 3.0.1
-
setSBDHIdentifierFactory
@ChangeNextMajorRelease("Remove the \'SBDH\' from the name - it\'s used outside as well") public static void setSBDHIdentifierFactory(@NonNull com.helger.peppolid.factory.IIdentifierFactory a) Set the default identifier factory used to parse SBDH data.- Parameters:
a- The identifier factory to use. May not benull.- Since:
- 3.0.1
-
isPerformSBDHValueChecks
public static boolean isPerformSBDHValueChecks()- Returns:
trueif SBDH value checks are enabled,falseif they are disabled.- Since:
- 0.12.1
-
setPerformSBDHValueChecks
public static void setPerformSBDHValueChecks(boolean b) Enable or disable the SBDH value checks. By default checks are enabled.- Parameters:
b-trueto enable the checks,falseto disable them- Since:
- 0.12.1
-
isCheckSBDHForMandatoryCountryC1
@Deprecated(forRemoval=true, since="4.2.4") public static boolean isCheckSBDHForMandatoryCountryC1()Deprecated, for removal: This API element is subject to removal in a future version.This is deprecated, because the feature is required for years, so there is no need anymore to disable this feature- Returns:
trueif the Country C1 element in the SBDH of received messages is mandatory, and if such messages should be rejected, if that field is missing. By default it is enabled.- Since:
- 2.7.1
-
setCheckSBDHForMandatoryCountryC1
@Deprecated(forRemoval=true, since="4.2.4") public static void setCheckSBDHForMandatoryCountryC1(boolean b) Deprecated, for removal: This API element is subject to removal in a future version.This is deprecated, because the feature is required for years, so there is no need anymore to disable this featureSet whether the check for the mandatory Country C1 element in SBDH of received message is mandatory or not. By default it is enabled.- Parameters:
b-trueto check,falseto disable the check.- Since:
- 2.7.1
-
isCheckSigningCertificateRevocation
public static boolean isCheckSigningCertificateRevocation()- Returns:
trueif the signing certificate should be checked for revocation,falseif not.- Since:
- 2.7.1
-
setCheckSigningCertificateRevocation
public static void setCheckSigningCertificateRevocation(boolean b) Set whether the signing certificate should be checked for revocation or not.- Parameters:
b-trueto check,falseto disable the check (not recommended).- Since:
- 2.7.1
-
getAPCAChecker
public static @Nullable com.helger.security.certificate.TrustedCAChecker getAPCAChecker()- Returns:
- The Peppol AP CA checker to be used. May be
null(since v3.2.2). - Since:
- 3.0.3
-
setAPCAChecker
public static void setAPCAChecker(@Nullable com.helger.security.certificate.TrustedCAChecker a) Set the Peppol CA checker to be used.- Parameters:
a- The Peppol CA checker to be used. May benull(since v3.2.2).- Since:
- 3.0.3
-
isAPRevocationSoftFail
public static boolean isAPRevocationSoftFail()- Returns:
trueto acceptECertificateCheckResult.REVOCATION_STATUS_UNKNOWNfrom the AP CA checker as valid (soft-fail),falseto treat it as invalid. Defaults toCertificateRevocationCheckerDefaults.isAllowSoftFail(). Applies to the inbound signing certificate check.- Since:
- 4.5.0
-
setAPRevocationSoftFail
public static void setAPRevocationSoftFail(boolean b) Set whether an undeterminable revocation status of the inbound AP signing certificate is accepted as valid (soft-fail) instead of being rejected.Security note: Peppol mandates revocation checks. Enabling soft-fail allows an inbound message with a potentially-revoked AP signing certificate to be accepted during a CRL/OCSP outage. Use only as a deliberate operational-continuity measure.
- Parameters:
b-trueto accept unknown revocation status,falseto reject.- Since:
- 4.5.0
-
getAPCacheRevocationCheckResult
public static @NonNull com.helger.base.state.ETriState getAPCacheRevocationCheckResult()- Returns:
- The revocation result caching override applied during the inbound signing certificate
check.
ETriState.UNDEFINED(the default) means "use the JVM-wide default fromCertificateRevocationCheckerDefaults". - Since:
- 4.5.0
-
setAPCacheRevocationCheckResult
public static void setAPCacheRevocationCheckResult(@NonNull com.helger.base.state.ETriState e) Override the revocation result caching flag for the inbound signing certificate check.- Parameters:
e-ETriState.TRUEto use the global revocation cache,ETriState.FALSEto bypass it,ETriState.UNDEFINED(the default) to use the JVM-wide default fromCertificateRevocationCheckerDefaults. May not benull.- Since:
- 4.5.0
-
getAPRevocationCheckMode
public static @Nullable com.helger.security.revocation.ERevocationCheckMode getAPRevocationCheckMode()- Returns:
- The revocation check mode override applied during the inbound signing certificate
check.
null(the default) means "use the JVM-wide default fromCertificateRevocationCheckerDefaults". - Since:
- 4.5.0
-
setAPRevocationCheckMode
public static void setAPRevocationCheckMode(@Nullable com.helger.security.revocation.ERevocationCheckMode e) Override the revocation check mode for the inbound signing certificate check.- Parameters:
e- The revocation check mode to use.null(the default) means "use the JVM-wide default fromCertificateRevocationCheckerDefaults".- Since:
- 4.5.0
-
getAsReceiverCheckDataBuilder
public static @NonNull Phase4PeppolReceiverConfiguration.Phase4PeppolReceiverConfigurationBuilder getAsReceiverCheckDataBuilder()Get the statically configured data as aPhase4PeppolReceiverConfiguration.Phase4PeppolReceiverConfigurationBuilderinstance. This allows for modification before building the final object.- Returns:
- Completely filled builder. Never
null. - Since:
- 3.0.0 Beta7
-
getAsReceiverCheckData
Get the statically configured data as aPhase4PeppolReceiverConfigurationinstance.- Returns:
- The instance data and never
null. - Since:
- 0.9.13
-