Class PKCS9Attributes
java.lang.Object
org.mozilla.jss.netscape.security.pkcs.PKCS9Attributes
A set of attributes of class PKCS9Attribute.
- Version:
- 1.2 97/12/10
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Hashtable
<ObjectIdentifier, PKCS9Attribute> Attributes in this set indexed by OID.private final byte[]
The DER encoding of this attribute set.private final Hashtable
<ObjectIdentifier, ObjectIdentifier> The keys of this hashtable are the OIDs of permitted attributes. -
Constructor Summary
ConstructorsConstructorDescriptionPKCS9Attributes
(PKCS9Attribute[] attribs) Construct a set of PKCS9 Attributes from the given array of PCK9 attributes.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. -
Method Summary
Modifier and TypeMethodDescription(package private) static DerEncoder[]
castToDerEncoder
(Object[] objs) Cast an object array whose components areDerEncoder
s toDerEncoder[]
.private byte[]
decode
(DerInputStream in) Decode this set of PKCS9 attribute set from the contents of its DER encoding.void
encode
(byte tag, OutputStream out) Put the DER encoding of this PKCS9 attribute set on an DerOutputStream, tagged with the given implicit tag.private byte[]
getAttribute
(String name) Get an attribute from this set.Get an attribute from this set.Get an array of all attributes in this set, in order of OID.getAttributeValue
(String name) Get an attribute value by type name.Get an attribute value by OID.byte[]
Return the DER encoding of this attribute set, tagged with DerValue.tag_SetOf.toString()
Returns the PKCS9 block in a printable string form.
-
Field Details
-
attributes
Attributes in this set indexed by OID. -
permittedAttributes
The keys of this hashtable are the OIDs of permitted attributes. -
derEncoding
private final byte[] derEncodingThe DER encoding of this attribute set. The tag byte must be DerValue.tag_SetOf.
-
-
Constructor Details
-
PKCS9Attributes
public PKCS9Attributes(ObjectIdentifier[] permittedAttributes, DerInputStream in) throws IOException 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:
-
PKCS9Attributes
Construct a set of PKCS9 Attributes from its contents of its DER encoding on a DerInputStream. Accept all attributes supported by class PKCS9Attribute.- Throws:
IOException
- on i/o error, encoding syntax error, or unsupported or duplicate attribute.- See Also:
-
PKCS9Attributes
Construct a set of PKCS9 Attributes from the given array of PCK9 attributes. DER encoding on a DerInputStream. All attributes inattribs
must be supported by class PKCS9Attribute.- Throws:
IOException
- on i/o error, encoding syntax error, or unsupported or duplicate attribute.IllegalArgumentException
- See Also:
-
-
Method Details
-
decode
Decode this set of PKCS9 attribute set from the contents of its DER encoding.- Parameters:
buf
- 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.
-
encode
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.
-
generateDerEncoding
- Throws:
IOException
-
getDerEncoding
Return the DER encoding of this attribute set, tagged with DerValue.tag_SetOf.- Throws:
IOException
-
getAttribute
Get an attribute from this set. -
getAttribute
Get an attribute from this set. -
getAttributes
Get an array of all attributes in this set, in order of OID. -
getAttributeValue
Get an attribute value by OID.- Throws:
IOException
-
getAttributeValue
Get an attribute value by type name.- Throws:
IOException
-
toString
Returns the PKCS9 block in a printable string form. -
castToDerEncoder
Cast an object array whose components areDerEncoder
s toDerEncoder[]
.
-