Class Name

java.lang.Object
org.apache.harmony.security.x501.Name

public final class Name
extends Object
X.501 Name
  • Field Summary

    Fields
    Modifier and Type Field Description
    static ASN1SequenceOf ASN1  
    static ASN1SetOf ASN1_RDN
    According to RFC 3280 (http://www.ietf.org/rfc/rfc3280.txt) X.501 Name structure is defined as follows: Name ::= CHOICE { RDNSequence } RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET OF AttributeTypeAndValue
  • Constructor Summary

    Constructors
    Constructor Description
    Name​(byte[] encoding)
    Creates new Name instance from its DER encoding
    Name​(String name)
    Creates new Name instance
  • Method Summary

    Modifier and Type Method Description
    byte[] getEncoded()
    Gets encoded form of DN
    String getName​(String format)
    Returns Relative Distinguished Name as String according the format requested
    X500Principal getX500Principal()
    Returns X500Principal instance corresponding to this Name instance

    Methods inherited from class java.lang.Object

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

    • ASN1_RDN

      public static final ASN1SetOf ASN1_RDN
      According to RFC 3280 (http://www.ietf.org/rfc/rfc3280.txt) X.501 Name structure is defined as follows: Name ::= CHOICE { RDNSequence } RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET OF AttributeTypeAndValue
    • ASN1

      public static final ASN1SequenceOf ASN1
  • Constructor Details

    • Name

      public Name​(byte[] encoding) throws IOException
      Creates new Name instance from its DER encoding
      Parameters:
      encoding - - ASN.1 DER encoding
      Throws:
      IOException - - if encoding is wrong
    • Name

      public Name​(String name) throws IOException
      Creates new Name instance
      Parameters:
      name - - Name as String
      Throws:
      IOException - - if string is wrong
  • Method Details

    • getX500Principal

      public X500Principal getX500Principal()
      Returns X500Principal instance corresponding to this Name instance
      Returns:
      equivalent X500Principal object
    • getName

      public String getName​(String format)
      Returns Relative Distinguished Name as String according the format requested
      Parameters:
      format - one of X500Principal.CANONICAL, X500Principal.RFC1779, or X500Principal.RFC2253, case insensitive
    • getEncoded

      public byte[] getEncoded()
      Gets encoded form of DN
      Returns:
      return encoding, no copying is performed