org.bouncycastle.asn1.esf.OcspIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcutil-fips Show documentation
Show all versions of bcutil-fips Show documentation
The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls with the BC FIPS provider. The APIs may also be used with other providers although if being used in a FIPS context it is the responsibility of the user to ensure that any other providers used are FIPS certified and used appropriately.
/***************************************************************/
/****** DO NOT EDIT THIS CLASS bc-java SOURCE FILE ******/
/***************************************************************/
package org.bouncycastle.asn1.esf;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1GeneralizedTime;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.ocsp.ResponderID;
/**
*
* OcspIdentifier ::= SEQUENCE {
* ocspResponderID ResponderID, -- As in OCSP response data
* producedAt GeneralizedTime -- As in OCSP response data
* }
*
*/
public class OcspIdentifier
extends ASN1Object
{
private ResponderID ocspResponderID;
private ASN1GeneralizedTime producedAt;
public static OcspIdentifier getInstance(Object obj)
{
if (obj instanceof OcspIdentifier)
{
return (OcspIdentifier)obj;
}
else if (obj != null)
{
return new OcspIdentifier(ASN1Sequence.getInstance(obj));
}
return null;
}
private OcspIdentifier(ASN1Sequence seq)
{
if (seq.size() != 2)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
this.ocspResponderID = ResponderID.getInstance(seq.getObjectAt(0));
this.producedAt = (ASN1GeneralizedTime)seq.getObjectAt(1);
}
public OcspIdentifier(ResponderID ocspResponderID, ASN1GeneralizedTime producedAt)
{
this.ocspResponderID = ocspResponderID;
this.producedAt = producedAt;
}
public ResponderID getOcspResponderID()
{
return this.ocspResponderID;
}
public ASN1GeneralizedTime getProducedAt()
{
return this.producedAt;
}
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(this.ocspResponderID);
v.add(this.producedAt);
return new DERSequence(v);
}
}