Friday, 21 February 2014

Java - Check if X509Certificate is a CA certificate

How to check in Java if an X509Certificate is a Certificate Authority trust certificate
 public boolean isCA(X509Certificate x509Cert) {
  if(x509Cert.getBasicConstraints() != -1) {
   return true;
  }
  return false;
 }

No comments:

Post a Comment