public class PKCS9Attributes
extends java.lang.Object
Constructor and Description |
---|
PKCS9Attributes(DerInputStream in)
Construct a set of PKCS9 Attributes from its contents of its
DER encoding on a DerInputStream.
|
PKCS9Attributes(ObjectIdentifier[] permittedAttributes,
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
PCK9 attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(byte tag,
java.io.OutputStream out)
Put the DER encoding of this PKCS9 attribute set on an
DerOutputStream, tagged with the given implicit tag.
|
PKCS9Attribute |
getAttribute(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(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(ObjectIdentifier[] permittedAttributes, 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.PKCS9Attribute
public PKCS9Attributes(DerInputStream in) throws java.io.IOException
java.io.IOException
- on i/o error, encoding syntax error, or unsupported or
duplicate attribute.PKCS9Attribute
public 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.IllegalArgumentException
PKCS9Attribute
public void encode(byte tag, java.io.OutputStream out) throws java.io.IOException
tag
- the implicit tag to use in the DER encoding.out
- the output stream on which to put the DER encoding.java.io.IOException
- on output error.public byte[] getDerEncoding() throws java.io.IOException
java.io.IOException
public PKCS9Attribute getAttribute(ObjectIdentifier oid)
public PKCS9Attribute getAttribute(java.lang.String name)
public PKCS9Attribute[] getAttributes()
public java.lang.Object getAttributeValue(ObjectIdentifier oid) throws java.io.IOException
java.io.IOException
public java.lang.Object getAttributeValue(java.lang.String name) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object