![JAR search and dependency download from the Maven repository](/logo.png)
nl.open.jwtdependency.org.bouncycastle.asn1.cmp.CertStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-jwt-nodependencies Show documentation
Show all versions of java-jwt-nodependencies Show documentation
This is a drop in replacement for the auth0 java-jwt library (see https://github.com/auth0/java-jwt). This jar makes sure there are no external dependencies (e.g. fasterXml, Apacha Commons) needed. This is useful when deploying to an application server (e.g. tomcat with Alfreso or Pega).
The newest version!
package org.bouncycastle.asn1.cmp;
import java.math.BigInteger;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DERSequence;
public class CertStatus
extends ASN1Object
{
private ASN1OctetString certHash;
private ASN1Integer certReqId;
private PKIStatusInfo statusInfo;
private CertStatus(ASN1Sequence seq)
{
certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
certReqId = ASN1Integer.getInstance(seq.getObjectAt(1));
if (seq.size() > 2)
{
statusInfo = PKIStatusInfo.getInstance(seq.getObjectAt(2));
}
}
public CertStatus(byte[] certHash, BigInteger certReqId)
{
this.certHash = new DEROctetString(certHash);
this.certReqId = new ASN1Integer(certReqId);
}
public CertStatus(byte[] certHash, BigInteger certReqId, PKIStatusInfo statusInfo)
{
this.certHash = new DEROctetString(certHash);
this.certReqId = new ASN1Integer(certReqId);
this.statusInfo = statusInfo;
}
public static CertStatus getInstance(Object o)
{
if (o instanceof CertStatus)
{
return (CertStatus)o;
}
if (o != null)
{
return new CertStatus(ASN1Sequence.getInstance(o));
}
return null;
}
public ASN1OctetString getCertHash()
{
return certHash;
}
public ASN1Integer getCertReqId()
{
return certReqId;
}
public PKIStatusInfo getStatusInfo()
{
return statusInfo;
}
/**
*
* CertStatus ::= SEQUENCE {
* certHash OCTET STRING,
* -- the hash of the certificate, using the same hash algorithm
* -- as is used to create and verify the certificate signature
* certReqId INTEGER,
* -- to match this confirmation with the corresponding req/rep
* statusInfo PKIStatusInfo OPTIONAL
* }
*
* @return a basic ASN.1 object representation.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(certHash);
v.add(certReqId);
if (statusInfo != null)
{
v.add(statusInfo);
}
return new DERSequence(v);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy