Package no.digipost.security.cert
Interface OcspPolicy
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface OcspPolicy
-
-
Field Summary
Fields Modifier and Type Field Description static OcspPolicyALWAYS_DO_OCSP_LOOKUPstatic OcspPolicyALWAYS_DO_OCSP_LOOKUP_EXCEPT_DIGIPOST_ISSUEDstatic OcspPolicyNEVER_DO_OCSP_LOOKUP
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static OcspPolicyalways(OcspDecision decision)Create a policy which always makes the givendecision.OcspDecisiondecideFor(TrustedCertificateAndIssuer trustedCertificateAndIssuer)Evaluate the given trustedcertificate and its issuer's certificateif an OCSP-lookup should be performed.default OcspPolicyexcept(Predicate<TrustedCertificateAndIssuer> trustedCertEvaluator, OcspDecision decisionResult)Create a new policy which yields anotherresultfor a certain case, or else yields what this policy would originally yield.
-
-
-
Field Detail
-
ALWAYS_DO_OCSP_LOOKUP
static final OcspPolicy ALWAYS_DO_OCSP_LOOKUP
-
NEVER_DO_OCSP_LOOKUP
static final OcspPolicy NEVER_DO_OCSP_LOOKUP
-
ALWAYS_DO_OCSP_LOOKUP_EXCEPT_DIGIPOST_ISSUED
static final OcspPolicy ALWAYS_DO_OCSP_LOOKUP_EXCEPT_DIGIPOST_ISSUED
-
-
Method Detail
-
always
static OcspPolicy always(OcspDecision decision)
Create a policy which always makes the givendecision.- Returns:
- the
OcspPolicy
-
decideFor
OcspDecision decideFor(TrustedCertificateAndIssuer trustedCertificateAndIssuer)
Evaluate the given trustedcertificate and its issuer's certificateif an OCSP-lookup should be performed.- Parameters:
trustedCertificateAndIssuer- the certificate and its issuer's certificate- Returns:
- the resulting
OcspDecision.
-
except
default OcspPolicy except(Predicate<TrustedCertificateAndIssuer> trustedCertEvaluator, OcspDecision decisionResult)
Create a new policy which yields anotherresultfor a certain case, or else yields what this policy would originally yield.- Parameters:
trustedCertEvaluator- the evaluator function for identifying if the givendecisionResultshould be the result of the new policy.decisionResult- the decision to yield if thetrustedCertEvaluatoryieldstrue.- Returns:
- the new
policy
-
-