Package net.dona.doip.util.tls

# 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 Summary

  Constructors
  Constructor
  Description
  `X509IdParser()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `parseIdentityHandle(X509Certificate cert)`
  Parses the identity handle from the certificate.
  `static String`
  `parseIdentityHandle(X509Certificate[] cert)`
  Parses the identity handle from the first certificate in a chain.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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