X509Principal (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.jce

## Class X509Principal

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.x509.X509Name
    - - org.bouncycastle.jce.X509Principal

- All Implemented Interfaces:
    java.security.Principal, ASN1Encodable, Encodable

  Deprecated.
  use the X500Name class.

      public class X509Principal
      extends X509Name
      implements java.security.Principal

  a general extension of X509Name with a couple of extra methods and constructors.

  Objects of this type can be created from certificates and CRLs using the PrincipalUtil class.

  See Also:
    `PrincipalUtil`

- - ### Field Summary

    - ### Fields inherited from class org.bouncycastle.asn1.x509.X509Name

      `BUSINESS_CATEGORY, C, CN, COUNTRY_OF_CITIZENSHIP, COUNTRY_OF_RESIDENCE, DATE_OF_BIRTH, DC, DefaultLookUp, DefaultReverse, DefaultSymbols, DMD_NAME, DN_QUALIFIER, E, EmailAddress, GENDER, GENERATION, GIVENNAME, INITIALS, L, NAME, NAME_AT_BIRTH, O, OIDLookUp, OU, PLACE_OF_BIRTH, POSTAL_ADDRESS, POSTAL_CODE, PSEUDONYM, RFC1779Symbols, RFC2253Symbols, SERIALNUMBER, SN, ST, STREET, SURNAME, SymbolLookUp, T, TELEPHONE_NUMBER, UID, UNIQUE_IDENTIFIER, UnstructuredAddress, UnstructuredName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `X509Principal(boolean reverse, java.util.Hashtable lookUp, java.lang.String dirName)` Deprecated. 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. lookUp should provide a table of lookups, indexed by lowercase only strings and yielding a ASN1ObjectIdentifier, other than that OID. and numeric oids will be processed automatically.
    `X509Principal(boolean reverse, java.lang.String dirName)` Deprecated. 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.
    `X509Principal(byte[] bytes)` Deprecated. Constructor from an encoded byte array.
    `X509Principal(java.util.Hashtable attributes)` Deprecated. constructor from a table of attributes.
    `X509Principal(java.lang.String dirName)` Deprecated. 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.
    `X509Principal(java.util.Vector ordering, java.util.Hashtable attributes)` Deprecated. constructor from a table of attributes and a vector giving the specific ordering required for encoding or conversion to a string.
    `X509Principal(java.util.Vector oids, java.util.Vector values)` Deprecated. constructor from a vector of attribute values and a vector of OIDs.
    `X509Principal(X500Name name)` Deprecated. Constructor from an X509Name object.
    `X509Principal(X509Name name)` Deprecated. Constructor from an X509Name object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getEncoded()` Deprecated. return a DER encoded byte array representing this object
    `java.lang.String` | `getName()` Deprecated.

    - ### Methods inherited from class org.bouncycastle.asn1.x509.X509Name

      `equals, equals, getInstance, getInstance, getOIDs, getValues, getValues, hashCode, toASN1Primitive, toString, toString`

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Object

      `getEncoded, hasEncodedTagValue, toASN1Object`

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

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

    - ### Methods inherited from interface java.security.Principal

      `equals, hashCode, toString`

- - ### Constructor Detail

    - #### X509Principal

          public X509Principal(byte[] bytes)
                        throws java.io.IOException

      Deprecated.
      Constructor from an encoded byte array.
      Throws:
        `java.io.IOException`

    - #### X509Principal

          public X509Principal(X509Name name)

      Deprecated.
      Constructor from an X509Name object.

    - #### X509Principal

          public X509Principal(X500Name name)

      Deprecated.
      Constructor from an X509Name object.

    - #### X509Principal

          public X509Principal(java.util.Hashtable attributes)

      Deprecated.
      constructor from a table of attributes.

      it's is assumed the table contains OID/String pairs.

    - #### X509Principal

          public X509Principal(java.util.Vector ordering,
                       java.util.Hashtable attributes)

      Deprecated.
      constructor from a table of attributes and a vector giving the specific ordering required for encoding or conversion to a string.

      it's is assumed the table contains OID/String pairs.

    - #### X509Principal

          public X509Principal(java.util.Vector oids,
                       java.util.Vector values)

      Deprecated.
      constructor from a vector of attribute values and a vector of OIDs.

    - #### X509Principal

          public X509Principal(java.lang.String dirName)

      Deprecated.
      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.

    - #### X509Principal

          public X509Principal(boolean reverse,
                       java.lang.String dirName)

      Deprecated.
      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. If reverse is false the dir name will be encoded in the order of the (name, value) pairs presented, otherwise the encoding will start with the last (name, value) pair and work back.

    - #### X509Principal

          public X509Principal(boolean reverse,
                       java.util.Hashtable lookUp,
                       java.lang.String dirName)

      Deprecated.
      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. lookUp should provide a table of lookups, indexed by lowercase only strings and yielding a ASN1ObjectIdentifier, other than that OID. and numeric oids will be processed automatically.

      If reverse is true, create the encoded version of the sequence starting from the last element in the string.

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Deprecated.
      Specified by:
        `getName` in interface `java.security.Principal`

    - #### getEncoded

          public byte[] getEncoded()

      Deprecated.
      return a DER encoded byte array representing this object
      Specified by:
        `getEncoded` in interface `Encodable`
      Overrides:
        `getEncoded` in class `ASN1Object`
      Returns:
        BER/DER byte encoded object.