1 package org.bouncycastle.asn1.x509;
3 import org.bouncycastle.asn1.*;
7 * GeneralName ::= CHOICE {
8 * otherName [0] OtherName,
9 * rfc822Name [1] IA5String,
10 * dNSName [2] IA5String,
11 * x400Address [3] ORAddress,
12 * directoryName [4] Name,
13 * ediPartyName [5] EDIPartyName,
14 * uniformResourceIdentifier [6] IA5String,
15 * iPAddress [7] OCTET STRING,
16 * registeredID [8] OBJECT IDENTIFIER}
18 * OtherName ::= SEQUENCE {
19 * type-id OBJECT IDENTIFIER,
20 * value [0] EXPLICIT ANY DEFINED BY type-id }
22 * EDIPartyName ::= SEQUENCE {
23 * nameAssigner [0] DirectoryString OPTIONAL,
24 * partyName [1] DirectoryString }
27 public class GeneralName
28 implements DEREncodable
34 X509Name directoryName)
36 this.obj = directoryName;
41 * When the subjectAltName extension contains an Internet mail address,
42 * the address MUST be included as an rfc822Name. The format of an
43 * rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822].
45 * When the subjectAltName extension contains a domain name service
46 * label, the domain name MUST be stored in the dNSName (an IA5String).
47 * The name MUST be in the "preferred name syntax," as specified by RFC
50 * When the subjectAltName extension contains a URI, the name MUST be
51 * stored in the uniformResourceIdentifier (an IA5String). The name MUST
52 * be a non-relative URL, and MUST follow the URL syntax and encoding
53 * rules specified in [RFC 1738]. The name must include both a scheme
54 * (e.g., "http" or "ftp") and a scheme-specific-part. The scheme-
55 * specific-part must include a fully qualified domain name or IP
56 * address as the host.
58 * When the subjectAltName extension contains a iPAddress, the address
59 * MUST be stored in the octet string in "network byte order," as
60 * specified in RFC 791 [RFC 791]. The least significant bit (LSB) of
61 * each octet is the LSB of the corresponding byte in the network
62 * address. For IP Version 4, as specified in RFC 791, the octet string
63 * MUST contain exactly four octets. For IP Version 6, as specified in
64 * RFC 1883, the octet string MUST contain exactly sixteen octets [RFC
68 DERObject name, int tag)
74 public DERObject getDERObject()
76 return new DERTaggedObject(false, tag, obj);