Class NameReader

java.lang.Object
org.cryptacular.x509.dn.NameReader

public class NameReader extends Object
Reads X.509 subject and issuer DNs as a raw sequence of attributes to facilitate precise handling of name parsing.
Author:
Middleware Services
  • Constructor Details

    • NameReader

      public NameReader(X509Certificate cert)
      Creates a new instance to support reading subject and issuer information on the given certificate.
      Parameters:
      cert - Certificate to read.
  • Method Details

    • readSubject

      public RDNSequence readSubject()
      Reads the subject field from the certificate.
      Returns:
      Subject DN as an RDN sequence.
    • readIssuer

      public RDNSequence readIssuer()
      Reads the issuer field from the certificate.
      Returns:
      Issuer DN as an RDN sequence.
    • readX500Principal

      public static RDNSequence readX500Principal(X500Principal principal)
      Converts the given X.500 principal to a list of relative distinguished names that contains the attributes comprising the DN.
      Parameters:
      principal - Principal to convert.
      Returns:
      X500 principal as an RDN sequence.