1 /*
2  * @(#) $Id: SubjectPublicKeyInfo.java,v 1.3 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.IOException;
13import org.jstk.asn1.*;
14
15/*
16 * SubjectPublicKeyInfo ::= SEQUENCE {
17 *   algorithm              AlgorithmIdentifier,
18 *   subjectPublicKey       BIT STRING }
19 */
20public class SubjectPublicKeyInfo extends ASN1Seq {
21    private AlgorithmIdentifier algorithm = new AlgorithmIdentifier();
22    private ASN1BitString subjectPublicKey = new ASN1BitString();
23
24    public SubjectPublicKeyInfo(){
25        super();
26        add(algorithm);
27        add(subjectPublicKey);
28    }
29
30    public void reinitialize(SubjectPublicKeyInfo pkInfo){
31        elems = pkInfo.elems;   // Shallow copy. beware !!
32    }
33    public String toString(){
34        StringBuffer sb = new StringBuffer();
35        sb.append("SubjectPublicKeyInfo-SEQ(" + algorithm.toString() + ", ");
36        sb.append(subjectPublicKey.toString() + ")");
37        return sb.toString();
38    }
39}
40
41