1
10package org.jstk.pki;
11
12import java.io.IOException;
13import org.jstk.asn1.*;
14
15
22public class CSRInfo extends ASN1Seq{
23 private ASN1Integer version = new ASN1Integer();
25 private Name subject = new Name();
26 private SubjectPublicKeyInfo publicKeyInfo = new SubjectPublicKeyInfo();
27 private ASN1Any attributes = new ASN1Any();
28
29 public CSRInfo(){
30 super();
31 attributes.setTagNumber(0);
32 attributes.setConsMask(CONSTRUCTED);
33
34 add(version);
35 add(subject);
36 add(publicKeyInfo);
37 add(attributes);
38 }
39
40 public ASN1Integer getVersion(){
41 return version;
42 }
43
44 public Name getSubject(){
45 return subject;
46 }
47
48 public void setSubject(Name subject){
49 this.subject = subject;
50 }
51
52 public SubjectPublicKeyInfo getPublicKeyInfo(){
53 return publicKeyInfo;
54 }
55
56 public ASN1Any getAttributes(){
57 return attributes;
58 }
59
60 public String toString(){
61 StringBuffer sb = new StringBuffer();
62 sb.append("CSRInfo-SEQ(" + version.toString() + ", " + subject.toString() + ", ");
63 sb.append(publicKeyInfo.toString() + ", " + attributes.toString() + ")");
64 return sb.toString();
65 }
66}
67
68