|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.ArrayList
|
+--codec.asn1.ASN1AbstractCollection
|
+--codec.asn1.ASN1Sequence
|
+--codec.pkcs7.ContentInfo
This class represents a ContentInfo as defined in PKCS#7.
The ASN.1 definition of this structure is
ContentInfo ::= SEQUENCE {
contentType ContentType,
content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
}
ContentType ::= OBJECT IDENTIFIER
contentType indicates the type of content. PKCS#7 specifies
six content types, of which five are supported: data,
signedData, envelopedData,
signedAndEnvelopedData, and
encryptedData. All of these content types have
registered OIDs.
The ContentInfo is also the general syntax of a complete
PKCS#7 structure.
| Field Summary | |
protected ASN1TaggedType |
content_
The actual content of this structure. |
protected ASN1ObjectIdentifier |
contentType_
The OID defining the contents of this structure. |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
ContentInfo()
This method creates an instance which is initialized for parsing. |
|
ContentInfo(ASN1ObjectIdentifier o)
This constructor sets the content type to the given OID but leaves the actual content empty. |
|
ContentInfo(ASN1RegisteredType o)
This method calls setContent with
the given ASN.1 type, which builds the tree of ASN.1 objects used for
decoding this structure. |
|
ContentInfo(OIDRegistry registry)
Creates an instance ready for decoding. |
|
| Method Summary | |
void |
decode(Decoder decoder)
Decodes this instance. |
ASN1Type |
getContent()
This method returns the actual content of this structure. |
ASN1ObjectIdentifier |
getContentType()
Returns the contentType of this structure. |
void |
setContent(ASN1ObjectIdentifier oid)
Sets the content type to the given OID and clears the actual content. |
void |
setContent(ASN1ObjectIdentifier oid,
ASN1Type type)
This method sets the OID and content of this structure. |
void |
setContent(ASN1RegisteredType type)
This method sets the content of this structure. |
| Methods inherited from class codec.asn1.ASN1Sequence |
getTag |
| Methods inherited from class codec.asn1.ASN1AbstractCollection |
checkConstraints, encode, getCollection, getConstraint, getTagClass, getValue, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, toString, writeExternal |
| Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
containsAll, remove, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList |
| Field Detail |
protected ASN1ObjectIdentifier contentType_
protected ASN1TaggedType content_
| Constructor Detail |
public ContentInfo()
PKCSRegistry is used for resolving OIDs to PKCS7
structures.public ContentInfo(OIDRegistry registry)
OIDRegistry is used to resolve content types. By default
the PKCSRegistry is used.registry - The Object Identifier registry that is used to resolve
content types, or null
if a default
registry shall be used.public ContentInfo(ASN1ObjectIdentifier o)
SignedData type in the case of signing detached
signatures. Such signatures require the content type to be
Data, but the actual data must be empty (no identifier,
length and contents octets).
This method calls {link #setContent(codec.asn1,ASN1ObjectIdentifier) setContent(oid)}.
o - The OID denoting the content type, most probably the
Data content OID.public ContentInfo(ASN1RegisteredType o)
setContent with
the given ASN.1 type, which builds the tree of ASN.1 objects used for
decoding this structure.o - The PKCS#7 content type to embed in this structure.| Method Detail |
public ASN1ObjectIdentifier getContentType()
contentType of this structure. This value is
defined only if the structure has been decoded successfully, or the
content has been set previously.contentType of this
structure.public ASN1Type getContent()
content of this structure.content or null if no content
is available.public void setContent(ASN1ObjectIdentifier oid)
oid - The OID that identifies the (empty) content type.public void setContent(ASN1RegisteredType type)
setContent(ASN1ObjectIdentifier, ASN1Type) with the OID returned by
ASN1RegisteredType.getOID().type - The content that shall be set.
public void setContent(ASN1ObjectIdentifier oid,
ASN1Type type)
oid - The OID that identifies the content type.type - The content.
public void decode(Decoder decoder)
throws ASN1Exception,
IOException
ASN1OpenType.decode in class ASN1AbstractCollectiondecoder - The Decoder to use.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||