本文整理汇总了Java中org.bouncycastle.ocsp.CertificateID类的典型用法代码示例。如果您正苦于以下问题:Java CertificateID类的具体用法?Java CertificateID怎么用?Java CertificateID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CertificateID类属于org.bouncycastle.ocsp包,在下文中一共展示了CertificateID类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GenOcspReq
import org.bouncycastle.ocsp.CertificateID; //导入依赖的package包/类
public static OCSPReq GenOcspReq(X509Certificate nextCert,
X509Certificate nextIssuer) throws OCSPException {
OCSPReqGenerator ocspRequestGenerator = new OCSPReqGenerator();
CertificateID certId = new CertificateID(CertificateID.HASH_SHA1,
nextIssuer, nextCert.getSerialNumber());
ocspRequestGenerator.addRequest(certId);
BigInteger nonce = BigInteger.valueOf(System.currentTimeMillis());
Vector<DERObjectIdentifier> oids = new Vector<DERObjectIdentifier>();
Vector<X509Extension> values = new Vector<X509Extension>();
oids.add(OCSPObjectIdentifiers.id_pkix_ocsp_nonce);
values.add(new X509Extension(false, new DEROctetString(nonce
.toByteArray())));
ocspRequestGenerator.setRequestExtensions(new X509Extensions(oids,
values));
return ocspRequestGenerator.generate();
}
示例2: creatCertReq
import org.bouncycastle.ocsp.CertificateID; //导入依赖的package包/类
/**
* Method for creating CertificateID for OCSP request
* @param signersCert
* @param caCert
* @param provider
* @return
* @throws NoSuchAlgorithmException
* @throws NoSuchProviderException
* @throws CertificateEncodingException
*/
private CertificateID creatCertReq(X509Certificate signersCert, X509Certificate caCert)
throws NoSuchAlgorithmException, NoSuchProviderException,
CertificateEncodingException, DigiDocException, Exception
{
return new CertificateID(CertificateID.HASH_SHA1, caCert, signersCert.getSerialNumber());
}