use of com.github.zhenwei.core.asn1.ocsp.CertID in project snowflake-jdbc by snowflakedb.
the class SSDManager method getWildCardCertId.
SFTrustManager.OcspResponseCacheKey getWildCardCertId() {
DigestCalculator digest = new SFTrustManager.SHA1DigestCalculator();
AlgorithmIdentifier algo = digest.getAlgorithmIdentifier();
ASN1OctetString nameHash = ASN1OctetString.getInstance("0");
ASN1OctetString keyHash = ASN1OctetString.getInstance("0");
ASN1Integer serial_number = ASN1Integer.getInstance(0);
CertID cid = new CertID(algo, nameHash, keyHash, serial_number);
SFTrustManager.OcspResponseCacheKey keyOcspResp = null;
try {
keyOcspResp = new SFTrustManager.OcspResponseCacheKey(ASN1OctetString.getInstance("0").getEncoded(), ASN1OctetString.getInstance("0").getEncoded(), ASN1Integer.getInstance(0).getValue());
} catch (Throwable ex) {
LOGGER.debug("Could not create wildcard certid as cache key");
keyOcspResp = null;
}
return keyOcspResp;
}
use of com.github.zhenwei.core.asn1.ocsp.CertID in project LinLong-Java by zhenwei1108.
the class CertBag method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(2);
v.add(certId);
v.add(new DERTaggedObject(0, certValue));
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ocsp.CertID in project LinLong-Java by zhenwei1108.
the class CertID method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* CertID ::= SEQUENCE {
* hashAlgorithm AlgorithmIdentifier,
* issuerNameHash OCTET STRING, -- Hash of Issuer's DN
* issuerKeyHash OCTET STRING, -- Hash of Issuers public key
* serialNumber CertificateSerialNumber }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(4);
v.add(hashAlgorithm);
v.add(issuerNameHash);
v.add(issuerKeyHash);
v.add(serialNumber);
return new DERSequence(v);
}
Aggregations