1 17 18 package org.apache.geronimo.util.asn1.pkcs; 19 20 import org.apache.geronimo.util.asn1.ASN1Encodable; 21 import org.apache.geronimo.util.asn1.ASN1EncodableVector; 22 import org.apache.geronimo.util.asn1.ASN1Sequence; 23 import org.apache.geronimo.util.asn1.DERBitString; 24 import org.apache.geronimo.util.asn1.DERObject; 25 import org.apache.geronimo.util.asn1.DERSequence; 26 import org.apache.geronimo.util.asn1.x509.AlgorithmIdentifier; 27 28 38 public class CertificationRequest 39 extends ASN1Encodable 40 { 41 protected CertificationRequestInfo reqInfo = null; 42 protected AlgorithmIdentifier sigAlgId = null; 43 protected DERBitString sigBits = null; 44 45 protected CertificationRequest() 46 { 47 } 48 49 public CertificationRequest( 50 CertificationRequestInfo requestInfo, 51 AlgorithmIdentifier algorithm, 52 DERBitString signature) 53 { 54 this.reqInfo = requestInfo; 55 this.sigAlgId = algorithm; 56 this.sigBits = signature; 57 } 58 59 public CertificationRequest( 60 ASN1Sequence seq) 61 { 62 reqInfo = CertificationRequestInfo.getInstance(seq.getObjectAt(0)); 63 sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1)); 64 sigBits = (DERBitString)seq.getObjectAt(2); 65 } 66 67 public CertificationRequestInfo getCertificationRequestInfo() 68 { 69 return reqInfo; 70 } 71 72 public AlgorithmIdentifier getSignatureAlgorithm() 73 { 74 return sigAlgId; 75 } 76 77 public DERBitString getSignature() 78 { 79 return sigBits; 80 } 81 82 public DERObject toASN1Object() 83 { 84 ASN1EncodableVector v = new ASN1EncodableVector(); 86 87 v.add(reqInfo); 88 v.add(sigAlgId); 89 v.add(sigBits); 90 91 return new DERSequence(v); 92 } 93 } 94 | Popular Tags |