本文整理汇总了Java中org.bouncycastle.asn1.ocsp.CertID类的典型用法代码示例。如果您正苦于以下问题:Java CertID类的具体用法?Java CertID怎么用?Java CertID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CertID类属于org.bouncycastle.asn1.ocsp包,在下文中一共展示了CertID类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CertificateID
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
public CertificateID(
CertID id)
{
if (id == null)
{
throw new IllegalArgumentException("'id' cannot be null");
}
this.id = id;
}
开发者ID:Appdome,项目名称:ipack,代码行数:10,代码来源:CertificateID.java
示例2: createCertID
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
private static CertID createCertID(DigestCalculator digCalc, X509CertificateHolder issuerCert, ASN1Integer serialNumber)
throws OCSPException
{
try
{
OutputStream dgOut = digCalc.getOutputStream();
dgOut.write(issuerCert.toASN1Structure().getSubject().getEncoded(ASN1Encoding.DER));
dgOut.close();
ASN1OctetString issuerNameHash = new DEROctetString(digCalc.getDigest());
SubjectPublicKeyInfo info = issuerCert.getSubjectPublicKeyInfo();
dgOut = digCalc.getOutputStream();
dgOut.write(info.getPublicKeyData().getBytes());
dgOut.close();
ASN1OctetString issuerKeyHash = new DEROctetString(digCalc.getDigest());
return new CertID(digCalc.getAlgorithmIdentifier(), issuerNameHash, issuerKeyHash, serialNumber);
}
catch (Exception e)
{
throw new OCSPException("problem creating ID: " + e, e);
}
}
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:CertificateID.java
示例3: CertEtcToken
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
private CertEtcToken(ASN1TaggedObject choice)
{
this.tagNo = choice.getTagNo();
switch (tagNo)
{
case TAG_CERTIFICATE:
value = Certificate.getInstance(choice, false);
break;
case TAG_ESSCERTID:
value = ESSCertID.getInstance(choice.getObject());
break;
case TAG_PKISTATUS:
value = PKIStatusInfo.getInstance(choice, false);
break;
case TAG_ASSERTION:
value = ContentInfo.getInstance(choice.getObject());
break;
case TAG_CRL:
value = CertificateList.getInstance(choice, false);
break;
case TAG_OCSPCERTSTATUS:
value = CertStatus.getInstance(choice.getObject());
break;
case TAG_OCSPCERTID:
value = CertID.getInstance(choice, false);
break;
case TAG_OCSPRESPONSE:
value = OCSPResponse.getInstance(choice, false);
break;
case TAG_CAPABILITIES:
value = SMIMECapabilities.getInstance(choice.getObject());
break;
default:
throw new IllegalArgumentException("Unknown tag: " + tagNo);
}
}
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:CertEtcToken.java
示例4: createCertID
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
private static CertID createCertID(AlgorithmIdentifier hashAlg, X509Certificate issuerCert,
ASN1Integer serialNumber, String provider)
throws OCSPException
{
try
{
MessageDigest digest = OCSPUtil.createDigestInstance(hashAlg.getAlgorithm() .getId(),
provider);
X509Principal issuerName = PrincipalUtil.getSubjectX509Principal(issuerCert);
digest.update(issuerName.getEncoded());
ASN1OctetString issuerNameHash = new DEROctetString(digest.digest());
PublicKey issuerKey = issuerCert.getPublicKey();
ASN1InputStream aIn = new ASN1InputStream(issuerKey.getEncoded());
SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(aIn.readObject());
digest.update(info.getPublicKeyData().getBytes());
ASN1OctetString issuerKeyHash = new DEROctetString(digest.digest());
return new CertID(hashAlg, issuerNameHash, issuerKeyHash, serialNumber);
}
catch (Exception e)
{
throw new OCSPException("problem creating ID: " + e, e);
}
}
开发者ID:Appdome,项目名称:ipack,代码行数:31,代码来源:CertificateID.java
示例5: toASN1Object
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
public CertID toASN1Object()
{
return id;
}
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:CertificateID.java
示例6: toASN1Primitive
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
public CertID toASN1Primitive()
{
return id;
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:5,代码来源:CertificateID.java
示例7: deriveCertificateID
import org.bouncycastle.asn1.ocsp.CertID; //导入依赖的package包/类
/**
* Create a new CertificateID for a new serial number derived from a previous one
* calculated for the same CA certificate.
*
* @param original the previously calculated CertificateID for the CA.
* @param newSerialNumber the serial number for the new certificate of interest.
*
* @return a new CertificateID for newSerialNumber
*/
public static CertificateID deriveCertificateID(CertificateID original, BigInteger newSerialNumber)
{
return new CertificateID(new CertID(original.id.getHashAlgorithm(), original.id.getIssuerNameHash(), original.id.getIssuerKeyHash(), new ASN1Integer(newSerialNumber)));
}
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:CertificateID.java
注:本文中的org.bouncycastle.asn1.ocsp.CertID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论