Class X509Name

  • All Implemented Interfaces:
    io.anyline.nfc.bouncycastle.asn1.ASN1Encodable , io.anyline.nfc.bouncycastle.util.Encodable

    
    public class X509Name
    extends ASN1Object
                        
        RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    
        RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
    
        AttributeTypeAndValue ::= SEQUENCE {
                                      type  OBJECT IDENTIFIER,
                                      value ANY }
    
    • Constructor Detail

      • X509Name

        X509Name(ASN1Sequence seq)
        Constructor from ASN1Sequence the principal will be a list of constructed sets, each containing an (OID, String) pair.
      • X509Name

        X509Name(Hashtable attributes)
        constructor from a table of attributes.
      • X509Name

        X509Name(Vector ordering, Hashtable attributes)
        Constructor from a table of attributes with ordering.
      • X509Name

        X509Name(Vector oids, Vector values)
        Takes two vectors one of the oids and the other of the values.
      • X509Name

        X509Name(String dirName)
        Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes.
      • X509Name

        X509Name(String dirName, X509NameEntryConverter converter)
        Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes with each string value being converted to its associated ASN.1 type using the passed in converter.
      • X509Name

        X509Name(boolean reverse, String dirName)
        Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes.
      • X509Name

        X509Name(boolean reverse, String dirName, X509NameEntryConverter converter)
        Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes with each string value being converted to its associated ASN.1 type using the passed in converter.
      • X509Name

        X509Name(boolean reverse, Hashtable lookUp, String dirName)
        Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes.
        Parameters:
        reverse - true if we should start scanning from the end (RFC 2553).
        lookUp - table of names and their oids.
        dirName - the X.500 string to be parsed.
      • X509Name

        X509Name(boolean reverse, Hashtable lookUp, String dirName, X509NameEntryConverter converter)
        Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes.
        Parameters:
        reverse - true if we should start scanning from the end, false otherwise.
        lookUp - table of names and oids.
        dirName - the string dirName
        converter - the converter to convert string values into their ASN.
    • Method Detail

      • getValues

         Vector getValues()

        return a vector of the values found in the name, in the order they were found.

      • getInstance

         static X509Name getInstance(ASN1TaggedObject obj, boolean explicit)

        Return a X509Name based on the passed in tagged object.

        Parameters:
        obj - tag object holding name.
        explicit - true if explicitly tagged false otherwise.
        Returns:

        the X509Name

      • getOIDs

         Vector getOIDs()

        return a vector of the oids in the name, in the order they were found.

      • getValues

         Vector getValues(ASN1ObjectIdentifier oid)

        return a vector of the values found in the name, in the order they were found, with the DN label corresponding to passed in oid.

      • toASN1Primitive

         ASN1Primitive toASN1Primitive()

        Method providing a primitive representation of this object suitable for encoding.

        Returns:

        a primitive representation of this object.

      • equals

         boolean equals(Object obj, boolean inOrder)
        Parameters:
        inOrder - if true the order of both X509 names must be the same, as well as the values associated with each element.
      • equals

         boolean equals(Object obj)

        test for equality - note: case is ignored.

      • toString

         String toString(boolean reverse, Hashtable oidSymbols)

        convert the structure to a string - if reverse is true the oids and values are listed out starting with the last element in the sequence (ala RFC 2253), otherwise the string will begin with the first element of the structure. If no string definition for the oid is found in oidSymbols the string value of the oid is added. Two standard symbol tables are provided DefaultSymbols, and RFC2253Symbols as part of this class.

        Parameters:
        reverse - if true start at the end of the sequence and work back.
        oidSymbols - look up table strings for oids.