public class

GeneralName

extends ASN1Encodable
implements ASN1Choice
java.lang.Object
   ↳ org.bouncycastle.asn1.ASN1Encodable
     ↳ org.bouncycastle.asn1.x509.GeneralName

Class Overview

The GeneralName object.

 GeneralName ::= CHOICE {
      otherName                       [0]     OtherName,
      rfc822Name                      [1]     IA5String,
      dNSName                         [2]     IA5String,
      x400Address                     [3]     ORAddress,
      directoryName                   [4]     Name,
      ediPartyName                    [5]     EDIPartyName,
      uniformResourceIdentifier       [6]     IA5String,
      iPAddress                       [7]     OCTET STRING,
      registeredID                    [8]     OBJECT IDENTIFIER}

 OtherName ::= SEQUENCE {
      type-id    OBJECT IDENTIFIER,
      value      [0] EXPLICIT ANY DEFINED BY type-id }

 EDIPartyName ::= SEQUENCE {
      nameAssigner            [0]     DirectoryString OPTIONAL,
      partyName               [1]     DirectoryString }
 
 Name ::= CHOICE { RDNSequence }
 

Summary

Constants
int dNSName
int directoryName
int ediPartyName
int iPAddress
int otherName
int registeredID
int rfc822Name
int uniformResourceIdentifier
int x400Address
[Expand]
Inherited Constants
From class org.bouncycastle.asn1.ASN1Encodable
Public Constructors
GeneralName(X509Name dirName)
GeneralName(X500Name dirName)
GeneralName(DERObject name, int tag)
This constructor is deprecated. this constructor seems the wrong way round! Use GeneralName(tag, name).
GeneralName(int tag, ASN1Encodable name)
When the subjectAltName extension contains an Internet mail address, the address MUST be included as an rfc822Name.
GeneralName(int tag, String name)
Create a GeneralName for the given tag from the passed in String.
Public Methods
static GeneralName getInstance(ASN1TaggedObject tagObj, boolean explicit)
static GeneralName getInstance(Object obj)
DEREncodable getName()
int getTagNo()
DERObject toASN1Object()
String toString()
[Expand]
Inherited Methods
From class org.bouncycastle.asn1.ASN1Encodable
From class java.lang.Object
From interface org.bouncycastle.asn1.DEREncodable

Constants

public static final int dNSName

Constant Value: 2 (0x00000002)

public static final int directoryName

Constant Value: 4 (0x00000004)

public static final int ediPartyName

Constant Value: 5 (0x00000005)

public static final int iPAddress

Constant Value: 7 (0x00000007)

public static final int otherName

Constant Value: 0 (0x00000000)

public static final int registeredID

Constant Value: 8 (0x00000008)

public static final int rfc822Name

Constant Value: 1 (0x00000001)

public static final int uniformResourceIdentifier

Constant Value: 6 (0x00000006)

public static final int x400Address

Constant Value: 3 (0x00000003)

Public Constructors

public GeneralName (X509Name dirName)

public GeneralName (X500Name dirName)

public GeneralName (DERObject name, int tag)

This constructor is deprecated.
this constructor seems the wrong way round! Use GeneralName(tag, name).

public GeneralName (int tag, ASN1Encodable name)

When the subjectAltName extension contains an Internet mail address, the address MUST be included as an rfc822Name. The format of an rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. When the subjectAltName extension contains a domain name service label, the domain name MUST be stored in the dNSName (an IA5String). The name MUST be in the "preferred name syntax," as specified by RFC 1034 [RFC 1034]. When the subjectAltName extension contains a URI, the name MUST be stored in the uniformResourceIdentifier (an IA5String). The name MUST be a non-relative URL, and MUST follow the URL syntax and encoding rules specified in [RFC 1738]. The name must include both a scheme (e.g., "http" or "ftp") and a scheme-specific-part. The scheme- specific-part must include a fully qualified domain name or IP address as the host. When the subjectAltName extension contains a iPAddress, the address MUST be stored in the octet string in "network byte order," as specified in RFC 791 [RFC 791]. The least significant bit (LSB) of each octet is the LSB of the corresponding byte in the network address. For IP Version 4, as specified in RFC 791, the octet string MUST contain exactly four octets. For IP Version 6, as specified in RFC 1883, the octet string MUST contain exactly sixteen octets [RFC 1883].

public GeneralName (int tag, String name)

Create a GeneralName for the given tag from the passed in String.

This constructor can handle:

  • rfc822Name
  • iPAddress
  • directoryName
  • dNSName
  • uniformResourceIdentifier
  • registeredID
For x400Address, otherName and ediPartyName there is no common string format defined.

Note: A directory name can be encoded in different ways into a byte representation. Be aware of this if the byte representation is used for comparing results.

Parameters
tag tag number
name string representation of name
Throws
IllegalArgumentException if the string encoding is not correct or * not supported.

Public Methods

public static GeneralName getInstance (ASN1TaggedObject tagObj, boolean explicit)

public static GeneralName getInstance (Object obj)

public DEREncodable getName ()

public int getTagNo ()

public DERObject toASN1Object ()

public String toString ()