ContentInfopublic class ContentInfo extends Object As defined in PKCS #7: Cryptographic Message Syntax Standard
(http://www.ietf.org/rfc/rfc2315.txt)
ContentInfo ::= SEQUENCE {
contentType ContentType,
content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
} |
Fields Summary |
---|
public static final int[] | DATA | public static final int[] | SIGNED_DATA | public static final int[] | ENVELOPED_DATA | public static final int[] | SIGNED_AND_ENVELOPED_DATA | public static final int[] | DIGESTED_DATA | public static final int[] | ENCRYPTED_DATA | private int[] | oid | private Object | content | private byte[] | encoding | public static final org.apache.harmony.security.asn1.ASN1Sequence | ASN1 |
Constructors Summary |
---|
public ContentInfo(int[] oid, Object content)
this.oid = oid;
this.content = content;
| private ContentInfo(int[] oid, Object content, byte[] encoding)
this.oid = oid;
this.content = content;
this.encoding = encoding;
|
Methods Summary |
---|
public java.lang.Object | getContent()
return content;
| public int[] | getContentType()
return oid;
| public byte[] | getEncoded()
if (encoding == null) {
encoding = ASN1.encode(this);
}
// Note: this is internal object and can not be accessible from
// public API, so encoding is not copied. The classes which use
// this class should copy encoding before passing it out.
return encoding;
| public SignedData | getSignedData()
if (Arrays.equals(oid, SIGNED_DATA)) {
return (SignedData)content;
}
return null;
| public java.lang.String | toString()
StringBuffer res = new StringBuffer();
res.append("==== ContentInfo:"); //$NON-NLS-1$
res.append("\n== ContentType (OID): "); //$NON-NLS-1$
for (int i = 0; i< oid.length; i++) {
res.append(oid[i]);
res.append(' ");
}
res.append("\n== Content: "); //$NON-NLS-1$
if (content != null) {
res.append("\n"); //$NON-NLS-1$
res.append(content.toString());
}
res.append("\n== Content End"); //$NON-NLS-1$
res.append("\n==== ContentInfo End\n"); //$NON-NLS-1$
return res.toString();
|
|