Class SignatureApiTrustStrategy
java.lang.Object
no.digipost.signature.client.core.internal.http.SignatureApiTrustStrategy
- All Implemented Interfaces:
org.apache.hc.core5.ssl.TrustStrategy
public final class SignatureApiTrustStrategy
extends Object
implements org.apache.hc.core5.ssl.TrustStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionSignatureApiTrustStrategy(CertificateChainValidation certificateChainValidation) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisTrusted(X509Certificate[] chain, String authType) Verify that the server certificate is trusted.
-
Constructor Details
-
SignatureApiTrustStrategy
-
-
Method Details
-
isTrusted
Verify that the server certificate is trusted. Note that we have to throw an Exception to make sure that invalid certificates will be denied. The http client TrustStrategy can only be used to used to state that a server certificate is to be trusted without consulting the standard Java certificate verification process. Unintuitively returnsfalsewhen theCertificateChainValidationdetermines the chain to beCertificateChainValidation.Result.TRUSTEDto make sure http client will run the Java certificate verification process, which will verify the certificate against the trust store, making sure that it's actually issued by a trusted CA.- Specified by:
isTrustedin interfaceorg.apache.hc.core5.ssl.TrustStrategy- See Also:
-