CertificationRequest.java
资源名称:security.rar [点击查看]
上传用户:lior1029
上传日期:2013-05-07
资源大小:209k
文件大小:2k
源码类别:
CA认证
开发平台:
Java
- package org.bouncycastle.asn1.pkcs;
- import java.io.*;
- import java.util.*;
- import org.bouncycastle.asn1.*;
- import org.bouncycastle.asn1.x509.*;
- /**
- * PKCS10
- *
- * <pre>
- * CertificationRequest ::= SEQUENCE {
- * certificationRequestInfo CertificationRequestInfo,
- * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
- * signature BIT STRING
- * }
- * </pre>
- */
- public class CertificationRequest
- implements DEREncodable
- {
- protected CertificationRequestInfo reqInfo = null;
- protected AlgorithmIdentifier sigAlgId = null;
- protected DERBitString sigBits = null;
- protected CertificationRequest()
- {
- }
- public CertificationRequest(
- CertificationRequestInfo requestInfo,
- AlgorithmIdentifier algorithm,
- DERBitString signature)
- {
- this.reqInfo = requestInfo;
- this.sigAlgId = algorithm;
- this.sigBits = signature;
- }
- public CertificationRequest(
- ASN1Sequence seq)
- {
- reqInfo = CertificationRequestInfo.getInstance(seq.getObjectAt(0));
- sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
- sigBits = (DERBitString)seq.getObjectAt(2);
- }
- public CertificationRequestInfo getCertificationRequestInfo()
- {
- return reqInfo;
- }
- public AlgorithmIdentifier getSignatureAlgorithm()
- {
- return sigAlgId;
- }
- public DERBitString getSignature()
- {
- return sigBits;
- }
- public DERObject getDERObject()
- {
- // Construct the CertificateRequest
- ASN1EncodableVector v = new ASN1EncodableVector();
- v.add(reqInfo);
- v.add(sigAlgId);
- v.add(sigBits);
- return new DERSequence(v);
- }
- }