|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.asn1.structures.Attributes iaik.cms.SignedAttributes
public class SignedAttributes
Signed attributes set of a CMS SignerInfo.
Provides an alternative way for getting the signed attributes from a
parsed SignerInfo
object:
SignerInfo signerInfo = ...; SignedAttributes signedAttributes = signerInfo.getSignedAttrs();
Field Summary |
---|
Fields inherited from class iaik.asn1.structures.Attributes |
---|
attributes_ |
Method Summary | |
---|---|
void |
addAttribute(Attribute attribute)
Adds the given attribute. |
void |
addAttribute(Attribute attribute,
boolean replace)
Adds the given attribute. |
void |
addAttributes(Attribute[] attributes)
Adds the given attributes. |
void |
clearAll()
Clears all attributes included in the container. |
void |
clearEncoded()
Clears the attributes encoding. |
byte[] |
getEncoded()
Returns the DER encoded implicitly tagged signed attributes. |
void |
insertAttributeAt(Attribute attribute,
int index)
Inserts the given attribute. |
boolean |
removeAttribute(Attribute attribute)
Removes the first representative of the given attribute. |
Attribute |
removeAttribute(ObjectID type)
Removes the first attribute with the given type from the container |
boolean |
removeAttributes(Attribute attribute)
Removes all representatives of the given attribute from the container. |
Attribute[] |
removeAttributes(ObjectID type)
Removes all attributes with the given type from the container |
int |
size()
Returns the number of attributes held by this Attributes object. |
Methods inherited from class iaik.asn1.structures.Attributes |
---|
encodeAsAsn1SEQUENCE, encodeAsAsn1SET, encodeAsAsn1SET, getAttribute, getAttributes, getAttributes, toArray, toAsn1SEQUENCE, toAsn1SET, toAsn1SET, toString, writeToAsn1SEQUENCE, writeToAsn1SET, writeToAsn1SET |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void addAttribute(Attribute attribute)
addAttribute
in class Attributes
attribute
- the attribute to be added.public void addAttribute(Attribute attribute, boolean replace)
addAttribute
in class Attributes
attribute
- the attribute to be added.replace
- whether to replace any already existing attribute with the given
typepublic void addAttributes(Attribute[] attributes)
addAttributes
in class Attributes
attributes
- the attributes to be added.public void insertAttributeAt(Attribute attribute, int index)
insertAttributeAt
in class Attributes
attribute
- the attribute to be inserted.index
- the position at which to insert the attributepublic boolean removeAttribute(Attribute attribute)
removeAttribute
in class Attributes
attribute
- the attribute to be removed
true
if the attribute has been removed,
false
if no such attribute was presentpublic Attribute removeAttribute(ObjectID type)
removeAttribute
in class Attributes
type
- the type of the attribute to be removed
null
if no attribute
with this type was presentpublic boolean removeAttributes(Attribute attribute)
removeAttributes
in class Attributes
attribute
- the attribute to be removed
true
if the attributes have been removed,
false
if no such attribute was presentpublic Attribute[] removeAttributes(ObjectID type)
removeAttributes
in class Attributes
type
- the type of the attributes to be removed
public int size()
public byte[] getEncoded() throws CodingException
According to the CMS specification (RFC 5652) the SignerInfo signed attributes are encoded as SET of Attribute, implicitly tagged wrapped into a CON_SPEC with tag 0:
SignerInfo ::= SEQUENCE { ... signedAttrs [0] IMPLICIT Attributes OPTIONAL, ... } SignedAttributes ::= SET SIZE (1..MAX) OF AttributeNote that the attributes are not wrapped into a CON_SPEC when calling any of the
writeToAsn1SET
, writeToAsn1SEQUENCE
methods.
CodingException
- if an Encoding error occurspublic void clearEncoded()
getEncoded()
will build the
internal ASN.1 structure anew. This may be required when any attributes
have been added/removed/changed from outside.
public void clearAll()
clearAll
in class Attributes
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |