public class PKCS9Attribute extends java.lang.Object implements DerEncoder
| 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) |
| 1.2.840.113549.1.9.16.2.12 | SigningCertificate | Single-valued | SigningCertificateInfo |
| 1.2.840.113549.1.9.16.2.14 | SignatureTimestampToken | Single-valued | byte[] |
| Constructor and Description |
|---|
PKCS9Attribute(DerValue derVal)
Construct a PKCS9Attribute from its encoding on an input
stream.
|
PKCS9Attribute(ObjectIdentifier oid,
java.lang.Object value)
Construct an attribute object from the attribute's OID and
value.
|
PKCS9Attribute(java.lang.String name,
java.lang.Object value)
Construct an attribute object from the attribute's name and
value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
derEncode(java.io.OutputStream out)
Write the DER encoding of this attribute to an output stream.
|
java.lang.String |
getName()
Return the name of this attribute.
|
static java.lang.String |
getName(ObjectIdentifier oid)
Return the attribute name for a given OID or null if we don't recognize
the oid.
|
ObjectIdentifier |
getOID()
Return the OID of this attribute.
|
static ObjectIdentifier |
getOID(java.lang.String name)
Return the OID for a given attribute name or null if we don't recognize
the name.
|
java.lang.Object |
getValue()
Get the value of this attribute.
|
boolean |
isSingleValued()
Show whether this attribute is single-valued.
|
java.lang.String |
toString()
Returns a string representation of this attribute.
|
public static final ObjectIdentifier EMAIL_ADDRESS_OID
public static final ObjectIdentifier UNSTRUCTURED_NAME_OID
public static final ObjectIdentifier CONTENT_TYPE_OID
public static final ObjectIdentifier MESSAGE_DIGEST_OID
public static final ObjectIdentifier SIGNING_TIME_OID
public static final ObjectIdentifier COUNTERSIGNATURE_OID
public static final ObjectIdentifier CHALLENGE_PASSWORD_OID
public static final ObjectIdentifier UNSTRUCTURED_ADDRESS_OID
public static final ObjectIdentifier EXTENDED_CERTIFICATE_ATTRIBUTES_OID
public static final ObjectIdentifier ISSUER_SERIALNUMBER_OID
public static final ObjectIdentifier EXTENSION_REQUEST_OID
public static final ObjectIdentifier SMIME_CAPABILITY_OID
public static final ObjectIdentifier SIGNING_CERTIFICATE_OID
public static final ObjectIdentifier SIGNATURE_TIMESTAMP_TOKEN_OID
public static final java.lang.String EMAIL_ADDRESS_STR
public static final java.lang.String UNSTRUCTURED_NAME_STR
public static final java.lang.String CONTENT_TYPE_STR
public static final java.lang.String MESSAGE_DIGEST_STR
public static final java.lang.String SIGNING_TIME_STR
public static final java.lang.String COUNTERSIGNATURE_STR
public static final java.lang.String CHALLENGE_PASSWORD_STR
public static final java.lang.String UNSTRUCTURED_ADDRESS_STR
public static final java.lang.String EXTENDED_CERTIFICATE_ATTRIBUTES_STR
public static final java.lang.String ISSUER_SERIALNUMBER_STR
public static final java.lang.String EXTENSION_REQUEST_STR
public static final java.lang.String SMIME_CAPABILITY_STR
public static final java.lang.String SIGNING_CERTIFICATE_STR
public static final java.lang.String SIGNATURE_TIMESTAMP_TOKEN_STR
public PKCS9Attribute(ObjectIdentifier oid, java.lang.Object value) throws java.lang.IllegalArgumentException
The
table gives the class that value
must have for a given attribute.
java.lang.IllegalArgumentExceptionpublic PKCS9Attribute(java.lang.String name,
java.lang.Object value)
throws java.lang.IllegalArgumentException
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.
java.lang.IllegalArgumentException - if the name is not recognized of the
value has the wrong type.public PKCS9Attribute(DerValue derVal) throws java.io.IOException
derVal - the DerValue representing the DER encoding of the attribute.java.io.IOException - on parsing error.public void derEncode(java.io.OutputStream out)
throws java.io.IOException
N.B.: This method always encodes values of
ChallengePassword and UnstructuredAddress attributes as ASN.1
PrintableStrings, without checking whether they
should be encoded as T61Strings.
derEncode in interface DerEncoderout - the stream on which the DER encoding is written.java.io.IOExceptionpublic java.lang.Object getValue()
The table gives the class of the value returned, depending on the type of this attribute.
public boolean isSingleValued()
public ObjectIdentifier getOID()
public java.lang.String getName()
public static ObjectIdentifier getOID(java.lang.String name)
public static java.lang.String getName(ObjectIdentifier oid)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2020. All Rights Reserved.