OCSPResponse.java
资源名称:security.rar [点击查看]
上传用户:lior1029
上传日期:2013-05-07
资源大小:209k
文件大小:1k
源码类别:
CA认证
开发平台:
Java
- package org.bouncycastle.asn1.ocsp;
- import org.bouncycastle.asn1.ASN1Sequence;
- import org.bouncycastle.asn1.ASN1TaggedObject;
- import org.bouncycastle.asn1.DERObject;
- import org.bouncycastle.asn1.DERSequence;
- import org.bouncycastle.asn1.DEREncodable;
- import org.bouncycastle.asn1.DERTaggedObject;
- import org.bouncycastle.asn1.ASN1EncodableVector;
- public class OCSPResponse
- implements DEREncodable
- {
- OCSPResponseStatus responseStatus;
- ResponseBytes responseBytes;
- public OCSPResponse(
- ASN1Sequence seq)
- {
- responseStatus = OCSPResponseStatus.getInstance(seq.getObjectAt(0));
- if (seq.size() == 2)
- {
- responseBytes = ResponseBytes.getInstance(
- (ASN1TaggedObject)seq.getObjectAt(1), true);
- }
- }
- public OCSPResponseStatus getResponseStatus()
- {
- return responseStatus;
- }
- public ResponseBytes getResponseBytes()
- {
- return responseBytes;
- }
- /**
- * <pre>
- * OCSPResponse ::= SEQUENCE {
- * responseStatus OCSPResponseStatus,
- * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
- * </pre>
- */
- public DERObject getDERObject()
- {
- ASN1EncodableVector v = new ASN1EncodableVector();
- v.add(responseStatus);
- if (responseBytes != null)
- {
- v.add(new DERTaggedObject(true, 0, responseBytes));
- }
- return new DERSequence(v);
- }
- }