public class PKCS9Attributes
extends java.lang.Object
| Constructor and Description |
|---|
PKCS9Attributes(com.tencent.kona.sun.security.util.DerInputStream in)
Construct a set of PKCS9 Attributes from the contents of its
DER encoding on a DerInputStream.
|
PKCS9Attributes(com.tencent.kona.sun.security.util.DerInputStream in,
boolean ignoreUnsupportedAttributes)
Construct a set of PKCS9 Attributes from the contents of its
DER encoding on a DerInputStream.
|
PKCS9Attributes(com.tencent.kona.sun.security.util.ObjectIdentifier[] permittedAttributes,
com.tencent.kona.sun.security.util.DerInputStream in)
Construct a set of PKCS9 Attributes from its
DER encoding on a DerInputStream, accepting only attributes
with OIDs on the given
list.
|
PKCS9Attributes(PKCS9Attribute[] attribs)
Construct a set of PKCS9 Attributes from the given array of
PKCS9 attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(byte tag,
com.tencent.kona.sun.security.util.DerOutputStream out)
Put the DER encoding of this PKCS9 attribute set on an
DerOutputStream, tagged with the given implicit tag.
|
PKCS9Attribute |
getAttribute(com.tencent.kona.sun.security.util.ObjectIdentifier oid)
Get an attribute from this set.
|
PKCS9Attribute |
getAttribute(java.lang.String name)
Get an attribute from this set.
|
PKCS9Attribute[] |
getAttributes()
Get an array of all attributes in this set, in order of OID.
|
java.lang.Object |
getAttributeValue(com.tencent.kona.sun.security.util.ObjectIdentifier oid)
Get an attribute value by OID.
|
java.lang.Object |
getAttributeValue(java.lang.String name)
Get an attribute value by type name.
|
byte[] |
getDerEncoding()
Return the DER encoding of this attribute set, tagged with
DerValue.tag_SetOf.
|
java.lang.String |
toString()
Returns the PKCS9 block in a printable string form.
|
public PKCS9Attributes(com.tencent.kona.sun.security.util.ObjectIdentifier[] permittedAttributes,
com.tencent.kona.sun.security.util.DerInputStream in)
throws java.io.IOException
permittedAttributes - Array of attribute OIDs that will be accepted.in - the contents of the DER encoding of the attribute set.java.io.IOException - on i/o error, encoding syntax error, unacceptable or
unsupported attribute, or duplicate attribute.PKCS9Attributepublic PKCS9Attributes(com.tencent.kona.sun.security.util.DerInputStream in)
throws java.io.IOException
in - the contents of the DER encoding of the attribute set.java.io.IOException - on i/o error, encoding syntax error, or unsupported or
duplicate attribute.PKCS9Attributepublic PKCS9Attributes(com.tencent.kona.sun.security.util.DerInputStream in,
boolean ignoreUnsupportedAttributes)
throws java.io.IOException
in - the contents of the DER encoding of the attribute set.ignoreUnsupportedAttributes - If true then any attributes
not supported by the PKCS9Attribute class are ignored. Otherwise,
unsupported attributes cause an exception to be thrown.java.io.IOException - on i/o error, encoding syntax error, or unsupported or
duplicate attribute.PKCS9Attributepublic PKCS9Attributes(PKCS9Attribute[] attribs) throws java.lang.IllegalArgumentException, java.io.IOException
attribs must be
supported by class PKCS9Attribute.java.io.IOException - on i/o error, encoding syntax error, or unsupported or
duplicate attribute.java.lang.IllegalArgumentExceptionPKCS9Attributepublic void encode(byte tag,
com.tencent.kona.sun.security.util.DerOutputStream out)
tag - the implicit tag to use in the DER encoding.out - the output stream on which to put the DER encoding.public byte[] getDerEncoding()
public PKCS9Attribute getAttribute(com.tencent.kona.sun.security.util.ObjectIdentifier oid)
public PKCS9Attribute getAttribute(java.lang.String name)
public PKCS9Attribute[] getAttributes()
public java.lang.Object getAttributeValue(com.tencent.kona.sun.security.util.ObjectIdentifier oid)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object getAttributeValue(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object