public class C509Name
extends java.lang.Object
Name = [ * RDNAttribute ] / SpecialText
RDNAttribute = ( ( attributeType: int, attributeValue: SpecialText ) //
( attributeType: ~oid, attributeValue: bytes ) )
SpecialText = text / bytes / tag
For an int-coded attribute the absolute value of the int is the C509 RDN Attributes
Registry value and the sign carries the DER string type (positive for utf8String,
negative for printableString; attributes that are always IA5String use a
non-negative int). Text values are compacted: a string of even length holding only
the symbols '0'-'9' and 'a'-'f' becomes a CBOR byte string, and an EUI-64 of the
form "HH-HH-HH-HH-HH-HH-HH-HH" (with "HH-HH-HH-FF-FE-HH-HH-HH" reduced to its
EUI-48 form) becomes a CBOR tag 48 item. A Name consisting of a single common name
attribute of type utf8String is encoded as just the attribute value.
Instances always hold both the CBOR encoding and the equivalent X500Name,
so conversion failures surface at construction rather than at use. A
RelativeDistinguishedName with more than one AttributeTypeAndValue has no C509
encoding and is rejected.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static C509Name |
fromX500Name(org.bouncycastle.asn1.x500.X500Name name)
Build the C509 form of an X.500 name.
|
byte[] |
getEncoded()
Return the CBOR encoding of this name.
|
static C509Name |
getInstance(byte[] cborEncoding)
Parse a C509 Name from its complete CBOR encoding.
|
int |
hashCode() |
org.bouncycastle.asn1.x500.X500Name |
toX500Name()
Return the X.500 view of this name.
|
public static C509Name getInstance(byte[] cborEncoding) throws java.io.IOException
java.io.IOExceptionpublic static C509Name fromX500Name(org.bouncycastle.asn1.x500.X500Name name)
java.lang.IllegalArgumentException - if the name cannot be represented in C509 -
only names whose RDNs are all single-valued can be.public org.bouncycastle.asn1.x500.X500Name toX500Name()
public byte[] getEncoded()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object