Breaking News
Home / ServerSide / Weblogic / How to find footprint of a Certificate?

How to find footprint of a Certificate?

A certificate’s fingerprint is not part of the certificate, but it can be computed from it. Browsers tend to display it as if it were part of the certificate. A fingerprint is the MD5 digest of the der-encoded CertificateInfo, which is an ASN.1 type specified as part of the X.509 specification.

The method calculates the fingerprint of a certificate, returning a byte array. Here is some code to demonstrate how to get the fingerprint of a certificate and print it out in hexadecimal:


public class fingerprint {

  private static char hexdigits[] = {

  public static void main(String[] argv)
       throws Exception
    InputStream is = null;
    JDK11Certificate cert = null;
    byte fp[];

    try {
      is = new FileInputStream(argv[0]);
    catch (FileNotFoundException e)  {
      System.out.println(“Can’t find file ” + argv[0]);

    try {
      cert = new JDK11Certificate(new X509(is));
    catch (Exception e) {

    fp = cert.getFingerprint();
    for (int i = 0; i < fp.length; i++) {
      System.out.print(” “
                       + hexdigits[(fp[i] & 0xff) >> 4]
                       + hexdigits[(fp[i] & 0xf)]);
  } }


Check Also

Error – Remote side declared peer gone on this JVM

Issue When trying to sent a JMS message to a remote Weblogic Application Server the …

Advertisment ad adsense adlogger