| java.lang.Object sun.security.pkcs.PKCS9Attribute
PKCS9Attribute | public class PKCS9Attribute implements DerEncoder(Code) | | Class supporting any PKCS9 attributes.
Supports DER decoding and access to attribute values, but not
DER encoding or setting of values.
Type/Class Table
The following table shows the correspondence between
PKCS9 attribute types and value component classes.
Object Identifier |
Attribute Name |
Type |
Value Class |
1.2.840.113549.1.9.1 |
EmailAddress |
Multi-valued |
String[] |
1.2.840.113549.1.9.2 |
UnstructuredName |
Multi-valued |
String[] |
1.2.840.113549.1.9.3 |
ContentType |
Single-valued |
ObjectIdentifier |
1.2.840.113549.1.9.4 |
MessageDigest |
Single-valued |
byte[] |
1.2.840.113549.1.9.5 |
SigningTime |
Single-valued |
Date |
1.2.840.113549.1.9.6 |
Countersignature |
Multi-valued |
SignerInfo[] |
1.2.840.113549.1.9.7 |
ChallengePassword |
Single-valued |
String |
1.2.840.113549.1.9.8 |
UnstructuredAddress |
Single-valued |
String |
1.2.840.113549.1.9.9 |
ExtendedCertificateAttributes |
Multi-valued |
(not supported) |
1.2.840.113549.1.9.10 |
IssuerAndSerialNumber |
Single-valued |
(not supported) |
1.2.840.113549.1.9.{11,12} |
RSA DSI proprietary |
Single-valued |
(not supported) |
1.2.840.113549.1.9.13 |
S/MIME unused assignment |
Single-valued |
(not supported) |
1.2.840.113549.1.9.14 |
ExtensionRequest |
Single-valued |
CertificateExtensions |
1.2.840.113549.1.9.15 |
SMIMECapability |
Single-valued |
(not supported) |
version: 1.7 02/02/00 author: Douglas Hoover |
Method Summary | |
public void | derEncode(OutputStream out) Write the DER encoding of this attribute to an output stream.
N.B.: This method always encodes values of
ChallengePassword and UnstructuredAddress attributes as ASN.1
PrintableString s, without checking whether they
should be encoded as T61String s. | public String | getName() Return the name of this attribute. | public static String | getName(ObjectIdentifier oid) Return the attribute name for a given OID or null if we don't recognize
the oid. | public ObjectIdentifier | getOID() Return the OID of this attribute. | public static ObjectIdentifier | getOID(String name) Return the OID for a given attribute name or null if we don't recognize
the name. | public Object | getValue() Get the value of this attribute. | static int | indexOf(Object obj, Object[] a, int start) Beginning the search at start , find the first
index i such that a[i] = obj . | public boolean | isSingleValued() Show whether this attribute is single-valued. | public String | toString() Returns a string representation of this attribute. |
CHALLENGE_PASSWORD_STR | final public static String CHALLENGE_PASSWORD_STR(Code) | | |
CONTENT_TYPE_STR | final public static String CONTENT_TYPE_STR(Code) | | |
COUNTERSIGNATURE_STR | final public static String COUNTERSIGNATURE_STR(Code) | | |
EMAIL_ADDRESS_STR | final public static String EMAIL_ADDRESS_STR(Code) | | |
EXTENDED_CERTIFICATE_ATTRIBUTES_OID | final public static ObjectIdentifier EXTENDED_CERTIFICATE_ATTRIBUTES_OID(Code) | | |
EXTENDED_CERTIFICATE_ATTRIBUTES_STR | final public static String EXTENDED_CERTIFICATE_ATTRIBUTES_STR(Code) | | |
EXTENSION_REQUEST_STR | final public static String EXTENSION_REQUEST_STR(Code) | | |
ISSUER_SERIALNUMBER_STR | final public static String ISSUER_SERIALNUMBER_STR(Code) | | |
MESSAGE_DIGEST_STR | final public static String MESSAGE_DIGEST_STR(Code) | | |
PKCS9_OIDS | final static ObjectIdentifier[] PKCS9_OIDS(Code) | | Array of attribute OIDs defined in PKCS9, by number.
|
SIGNING_TIME_STR | final public static String SIGNING_TIME_STR(Code) | | |
SMIME_CAPABILITY_STR | final public static String SMIME_CAPABILITY_STR(Code) | | |
UNSTRUCTURED_ADDRESS_STR | final public static String UNSTRUCTURED_ADDRESS_STR(Code) | | |
UNSTRUCTURED_NAME_STR | final public static String UNSTRUCTURED_NAME_STR(Code) | | |
PKCS9Attribute | public PKCS9Attribute(ObjectIdentifier oid, Object value) throws IllegalArgumentException(Code) | | Construct an attribute object from the attribute's OID and
value. If the attribute is single-valued, provide only one
value. If the attribute is multi-valued, provide an array
containing all the values.
Arrays of length zero are accepted, though probably useless.
The
table gives the class that value
must have for a given attribute.
|
PKCS9Attribute | public PKCS9Attribute(String name, Object value) throws IllegalArgumentException(Code) | | Construct an attribute object from the attribute's name and
value. If the attribute is single-valued, provide only one
value. If the attribute is multi-valued, provide an array
containing all the values.
Arrays of length zero are accepted, though probably useless.
The
table gives the class that value
must have for a given attribute. Reasonable variants of these
attributes are accepted; in particular, case does not matter.
exception: IllegalArgumentException - if the name is not recognized of thevalue has the wrong type. |
PKCS9Attribute | public PKCS9Attribute(DerValue derVal) throws IOException(Code) | | Construct a PKCS9Attribute from its encoding on an input
stream.
Parameters: val - the DerValue representing the DER encoding of the attribute. exception: IOException - on parsing error. |
derEncode | public void derEncode(OutputStream out) throws IOException(Code) | | Write the DER encoding of this attribute to an output stream.
N.B.: This method always encodes values of
ChallengePassword and UnstructuredAddress attributes as ASN.1
PrintableString s, without checking whether they
should be encoded as T61String s.
|
getName | public String getName()(Code) | | Return the name of this attribute.
|
getName | public static String getName(ObjectIdentifier oid)(Code) | | Return the attribute name for a given OID or null if we don't recognize
the oid.
|
getOID | public static ObjectIdentifier getOID(String name)(Code) | | Return the OID for a given attribute name or null if we don't recognize
the name.
|
getValue | public Object getValue()(Code) | | Get the value of this attribute. If the attribute is
single-valued, return just the one value. If the attribute is
multi-valued, return an array containing all the values.
It is possible for this array to be of length 0.
The
table gives the class of the value returned,
depending on the type of this attribute.
|
indexOf | static int indexOf(Object obj, Object[] a, int start)(Code) | | Beginning the search at start , find the first
index i such that a[i] = obj .
the index, if found, and -1 otherwise. |
isSingleValued | public boolean isSingleValued()(Code) | | Show whether this attribute is single-valued.
|
toString | public String toString()(Code) | | Returns a string representation of this attribute.
|
|
|