1 /*
2  * @(#) $Id: ContentInfo.java,v 1.2 2003/07/08 08:13:53 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
10package org.jstk.pki;
11
12import java.io.*;
13
14import org.jstk.asn1.*;
15import org.jstk.pem.*;
16import java.math.BigInteger;
17
18/*
19 * From PKCS#7:
20 * ContentInfo ::= SEQUENCE {
21 *   contentType                ContentType,
22 *   content                    [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL,
23 * }
24 */
25public class ContentInfo extends ASN1Seq{
26    private ASN1Oid contentType = new ASN1Oid();
27    private ASN1Explicit content = new ASN1Explicit(CONTEXT, EXPLICIT, 0);
28
29    public ContentInfo(){
30        super();
31        content.setOptional(true);
32
33        add(contentType);
34        add(content);
35    }
36
37    public ASN1Oid getContentType(){
38        return contentType;
39    }
40
41    public ASN1Explicit getContent(){
42        return content;
43    }
44
45    public String toString(){
46        return ("ContentInfo-SEQ(" + contentType.toString() + ", " + content.toString() + ")");
47    }
48}
49
50