org.webdocwf.util.smime.cms
Class Attribute

java.lang.Object
  |
  +--org.webdocwf.util.smime.der.DERObject
        |
        +--org.webdocwf.util.smime.der.DERSequencePr
              |
              +--org.webdocwf.util.smime.cms.Attribute
Direct Known Subclasses:
CapabilitiesAttribute, ContentTypeAttribute, MessageDigestAttribute, SigningTimeAttribute

public class Attribute
extends DERSequencePr

Attribute class is super class for all DER encoded attributes represented in ASN.1 notation according to RFC2630. Attributes are implemented in CMSSignedObject which is used in designing signed messages.

Attribute ::= SEQUENCE {
attrType OBJECT IDENTIFIER,
attrValues SET OF AttributeValue }

AttributeValue ::= ANY


Constructor Summary
Attribute(int[] arrayID0)
          Array of numbers is used for construction of desired attribute's DER Object Identifier.
Attribute(java.lang.String id0, java.lang.String typeOfAttribute0)
          This constructor has two different forms, depend on parameter typeConstruction0, which can be: DOT_SEPARATED_ARRAY or NAME_STRING.
 
Method Summary
 void addContent(byte[] parameter0)
          Adding value to defined DER encoded attribute
 byte[] getDEREncoded()
          Returns DER encoded attribute
 
Methods inherited from class org.webdocwf.util.smime.der.DERObject
getContentOctets, getContentPartSize, getIdentifierOctet, getLengthOctets, getLengthPartSize, getTagClassType, getTagComplexity, getTagTypeNumber, getTotalSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String id0,
                 java.lang.String typeOfAttribute0)
          throws SMIMEException
This constructor has two different forms, depend on parameter typeConstruction0, which can be: DOT_SEPARATED_ARRAY or NAME_STRING. If typeConstruction0 parameter is DOT_SEPARATED_ARRAY then id0 definition is represented by numbers separated with dots (example: "1.2.840.113549.1.9.4"). In case of NAME_STRING, id0 definition is name of object identifier for attribute (example: "ID_MESSAGEDIGEST").
Parameters:
id0 - defines Object Identifier in representation determined by second parameter - typeConstruction0.
typeOfAttribute0 - can take values DOT_SEPARATED_ARRAY and NAME_STRING
Throws:
SMIMEException - if wrong type of parameters are passed to the constructor. Also, it can be thrown from super class constructor or its addContent method.

Attribute

public Attribute(int[] arrayID0)
          throws SMIMEException
Array of numbers is used for construction of desired attribute's DER Object Identifier. Every number in array represents one number between dots in object identifier string.
Parameters:
arrayID0 - array of given numbers (example: for ID_MESSAGEDIGEST attributes, numbers are 1, 2, 840, 113549, 1, 9 and 4).
Throws:
SMIMEException - if wrong type of parameters are passed to the constructor. Also, it can be thrown from super class constructor or its addContent method.
Method Detail

addContent

public void addContent(byte[] parameter0)
                throws SMIMEException
Adding value to defined DER encoded attribute
Overrides:
addContent in class DERSequencePr
Parameters:
parameter0 - byte array representation of attribute value
Throws:
SMIMEException - thrown from super class addContent method.

getDEREncoded

public byte[] getDEREncoded()
                     throws SMIMEException
Returns DER encoded attribute
Overrides:
getDEREncoded in class DERObject
Returns:
DER encoded Attribute as byte array
Throws:
SMIMEException - if no value was added to attribute. Also, it can be thrown from super class getDEREncoded method.


Copyright © 2002-2002 Together Teamlösungen. All Rights Reserved.