Class DistinguishedNameParser


  • final class DistinguishedNameParser
    extends java.lang.Object
    A distinguished name (DN) parser. This parser only supports extracting a string value from a DN. It doesn't support values in the hex-string style.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int beg  
      private char[] chars
      Distinguished name characters.
      private int cur
      Temporary variable to store positions of the currently parsed item.
      private java.lang.String dn  
      private int end  
      private int length  
      private int pos  
    • Constructor Summary

      Constructors 
      Constructor Description
      DistinguishedNameParser​(javax.security.auth.x500.X500Principal principal)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String escapedAV()  
      java.lang.String findMostSpecific​(java.lang.String attributeType)
      Parses the DN and returns the most significant attribute value for an attribute type, or null if none found.
      private int getByte​(int position)  
      private char getEscaped()  
      private char getUTF8()  
      private java.lang.String hexAV()  
      private java.lang.String nextAT()  
      private java.lang.String quotedAV()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dn

        private final java.lang.String dn
      • length

        private final int length
      • pos

        private int pos
      • beg

        private int beg
      • end

        private int end
      • cur

        private int cur
        Temporary variable to store positions of the currently parsed item.
      • chars

        private char[] chars
        Distinguished name characters.
    • Constructor Detail

      • DistinguishedNameParser

        public DistinguishedNameParser​(javax.security.auth.x500.X500Principal principal)
    • Method Detail

      • nextAT

        private java.lang.String nextAT()
      • quotedAV

        private java.lang.String quotedAV()
      • hexAV

        private java.lang.String hexAV()
      • escapedAV

        private java.lang.String escapedAV()
      • getEscaped

        private char getEscaped()
      • getUTF8

        private char getUTF8()
      • getByte

        private int getByte​(int position)
      • findMostSpecific

        public java.lang.String findMostSpecific​(java.lang.String attributeType)
        Parses the DN and returns the most significant attribute value for an attribute type, or null if none found.
        Parameters:
        attributeType - attribute type to look for (e.g. "ca")