Class X500Name

  • All Implemented Interfaces:
    ASN1Choice, ASN1Encodable, Encodable

    public class X500Name
    extends ASN1Object
    implements ASN1Choice
    The X.500 Name object.
         Name ::= CHOICE {
                           RDNSequence }
    
         RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    
         RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
    
         AttributeTypeAndValue ::= SEQUENCE {
                                       type  OBJECT IDENTIFIER,
                                       value ANY }
     
    • Constructor Detail

      • X500Name

        public X500Name​(X500NameStyle style,
                        X500Name name)
        Deprecated.
        use the getInstance() method that takes a style.
      • X500Name

        public X500Name​(RDN[] rDNs)
      • X500Name

        public X500Name​(java.lang.String dirName)
      • X500Name

        public X500Name​(X500NameStyle style,
                        java.lang.String dirName)
    • Method Detail

      • getInstance

        public static X500Name getInstance​(ASN1TaggedObject obj,
                                           boolean explicit)
        Return a X500Name based on the passed in tagged object.
        Parameters:
        obj - tag object holding name.
        explicit - true if explicitly tagged false otherwise.
        Returns:
        the X500Name
      • getInstance

        public static X500Name getInstance​(java.lang.Object obj)
      • getRDNs

        public RDN[] getRDNs()
        return an array of RDNs in structure order.
        Returns:
        an array of RDN objects.
      • getAttributeTypes

        public ASN1ObjectIdentifier[] getAttributeTypes()
        return an array of OIDs contained in the attribute type of each RDN in structure order.
        Returns:
        an array, possibly zero length, of ASN1ObjectIdentifiers objects.
      • getRDNs

        public RDN[] getRDNs​(ASN1ObjectIdentifier attributeType)
        return an array of RDNs containing the attribute type given by OID in structure order.
        Parameters:
        attributeType - the type OID we are looking for.
        Returns:
        an array, possibly zero length, of RDN objects.
      • equals

        public boolean equals​(java.lang.Object obj)
        test for equality - note: case is ignored.
        Overrides:
        equals in class ASN1Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setDefaultStyle

        public static void setDefaultStyle​(X500NameStyle style)
        Set the default style for X500Name construction.
        Parameters:
        style - an X500NameStyle
      • getDefaultStyle

        public static X500NameStyle getDefaultStyle()
        Return the current default style.
        Returns:
        default style for X500Name construction.