-
I have updated my bouncy castle from bcpkix-jdk15on to bcpkix-jdk18on and bcprov-jdk15on to bcprov-jdk18on both version is 1.78.1. private static boolean checkIfValidBIC8(X509Certificate cert, String bic8Code) throws CertificateNotYetValidException, CertificateExpiredException, CertificateEncodingException {
Boolean result = true;
try {
cert.checkValidity();
PublicKey key = cert.getSubjectX500Principal();
X500Name x500name = new JcaX509CertificateHolder(cert).getSubject();
RDN orgId = x500name.getRDNs(BCStyle.O)[0];
AttributeTypeAndValue orgAttr = orgId.getFirst();
String extractedBIC8FromCertificateO = "";
if (orgAttr.getValue() != null)
extractedBIC8FromCertificateO = orgAttr.getValue().toString().trim().toUpperCase();
if (!extractedBIC8FromCertificateO.contains(bic8Code.trim().toUpperCase())) {
logger.error("the given bicCode8:["+bic8Code+"] is mismatched with the server certificate !");
result = false;
}
}
catch (Exception e) {
result=false;
}
return result;
} |
Beta Was this translation helpful? Give feedback.
Answered by
dghgit
Jul 16, 2024
Replies: 1 comment
-
It's definitely in there. I'd check the classpath again. Your update may not have gone entirely to plan. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
a-bayat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's definitely in there. I'd check the classpath again. Your update may not have gone entirely to plan.