Class X509IdParser

java.lang.Object
net.dona.doip.util.tls.X509IdParser

public class X509IdParser extends Object
Utility methods to parse a (handle) identity from an X509 certificate. The identity will be taken from the subject's distinguished name; it will use the first available UID attribute if present, otherwise the first available CN attribute if present, otherwise the first available O attribute if present.
  • Constructor Details

    • X509IdParser

      public X509IdParser()
  • Method Details

    • parseIdentityHandle

      public static String parseIdentityHandle(X509Certificate cert)
      Parses the identity handle from the certificate.
      Parameters:
      cert - the certificate
      Returns:
      the identity handle
    • parseIdentityHandle

      public static String parseIdentityHandle(X509Certificate[] cert)
      Parses the identity handle from the first certificate in a chain.
      Parameters:
      cert - the certificate chain
      Returns:
      the identity handle