public class

PKCS9Attributes

extends Object
java.lang.Object
   ↳ sun.security.pkcs.PKCS9Attributes

Class Overview

A set of attributes of class PKCS9Attribute.

Summary

Public Constructors
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(DerInputStream in)
Construct a set of PKCS9 Attributes from the contents of its DER encoding on a DerInputStream.
PKCS9Attributes(DerInputStream in, boolean ignoreUnsupportedAttributes)
Construct a set of PKCS9 Attributes from the contents of its DER encoding on a DerInputStream.
PKCS9Attributes(PKCS9Attribute[] attribs)
Construct a set of PKCS9 Attributes from the given array of PKCS9 attributes.
Public Methods
void encode(byte tag, OutputStream out)
Put the DER encoding of this PKCS9 attribute set on an DerOutputStream, tagged with the given implicit tag.
PKCS9Attribute getAttribute(String name)
Get an attribute from this set.
PKCS9Attribute getAttribute(ObjectIdentifier oid)
Get an attribute from this set.
Object getAttributeValue(String name)
Get an attribute value by type name.
Object getAttributeValue(ObjectIdentifier oid)
Get an attribute value by OID.
PKCS9Attribute[] getAttributes()
Get an array of all attributes in this set, in order of OID.
byte[] getDerEncoding()
Return the DER encoding of this attribute set, tagged with DerValue.tag_SetOf.
String toString()
Returns the PKCS9 block in a printable string form.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public 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. If the array is null, accept all attributes supported by class PKCS9Attribute.

Parameters
permittedAttributes Array of attribute OIDs that will be accepted.
in the contents of the DER encoding of the attribute set.
Throws
IOException on i/o error, encoding syntax error, unacceptable or unsupported attribute, or duplicate attribute.
See Also

public PKCS9Attributes (DerInputStream in)

Construct a set of PKCS9 Attributes from the contents of its DER encoding on a DerInputStream. Accept all attributes supported by class PKCS9Attribute and reject any unsupported attributes.

Parameters
in the contents of the DER encoding of the attribute set.
Throws
IOException on i/o error, encoding syntax error, or unsupported or duplicate attribute.
See Also

public PKCS9Attributes (DerInputStream in, boolean ignoreUnsupportedAttributes)

Construct a set of PKCS9 Attributes from the contents of its DER encoding on a DerInputStream. Accept all attributes supported by class PKCS9Attribute and ignore any unsupported attributes, if directed.

Parameters
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.
Throws
IOException on i/o error, encoding syntax error, or unsupported or duplicate attribute.
See Also

public PKCS9Attributes (PKCS9Attribute[] attribs)

Construct a set of PKCS9 Attributes from the given array of PKCS9 attributes. DER encoding on a DerInputStream. All attributes in attribs must be supported by class PKCS9Attribute.

Throws
IOException on i/o error, encoding syntax error, or unsupported or duplicate attribute.
IllegalArgumentException
See Also

Public Methods

public void encode (byte tag, OutputStream out)

Put the DER encoding of this PKCS9 attribute set on an DerOutputStream, tagged with the given implicit tag.

Parameters
tag the implicit tag to use in the DER encoding.
out the output stream on which to put the DER encoding.
Throws
IOException on output error.

public PKCS9Attribute getAttribute (String name)

Get an attribute from this set.

public PKCS9Attribute getAttribute (ObjectIdentifier oid)

Get an attribute from this set.

public Object getAttributeValue (String name)

Get an attribute value by type name.

Throws
IOException

public Object getAttributeValue (ObjectIdentifier oid)

Get an attribute value by OID.

Throws
IOException

public PKCS9Attribute[] getAttributes ()

Get an array of all attributes in this set, in order of OID.

public byte[] getDerEncoding ()

Return the DER encoding of this attribute set, tagged with DerValue.tag_SetOf.

Throws
IOException

public String toString ()

Returns the PKCS9 block in a printable string form.

Returns
  • a string representation of the object.