本文整理汇总了Java中org.bouncycastle.asn1.x509.CertificateList.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java CertificateList.getInstance方法的具体用法?Java CertificateList.getInstance怎么用?Java CertificateList.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.x509.CertificateList
的用法示例。
在下文中一共展示了CertificateList.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readDERCRL
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private CRL readDERCRL(
InputStream in)
throws IOException, CRLException
{
ASN1InputStream dIn = new ASN1InputStream(in);
ASN1Sequence seq = (ASN1Sequence)dIn.readObject();
if (seq.size() > 1
&& seq.getObjectAt(0) instanceof DERObjectIdentifier)
{
if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
{
sData = new SignedData(ASN1Sequence.getInstance(
(ASN1TaggedObject)seq.getObjectAt(1), true)).getCRLs();
return getCRL();
}
}
return new X509CRLObject(CertificateList.getInstance(seq));
}
示例2: getCrls
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
public CertificateList[] getCrls()
{
if (crls == null)
{
return null;
}
CertificateList[] results = new CertificateList[crls.size()];
for (int i = 0; i != results.length; i++)
{
results[i] = CertificateList.getInstance(crls.getObjectAt(i));
}
return results;
}
示例3: execute0
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
@Override
protected Object execute0() throws Exception {
CertificateList crl = CertificateList.getInstance(IoUtil.read(inFile));
if (crlNumber != null && crlNumber) {
ASN1Encodable asn1 = crl.getTBSCertList().getExtensions().getExtensionParsedValue(
Extension.cRLNumber);
if (asn1 == null) {
return "null";
}
return getNumber(ASN1Integer.getInstance(asn1).getPositiveValue());
} else if (issuer != null && issuer) {
return crl.getIssuer().toString();
} else if (thisUpdate != null && thisUpdate) {
return toUtcTimeyyyyMMddhhmmssZ(crl.getThisUpdate().getDate());
} else if (nextUpdate != null && nextUpdate) {
return crl.getNextUpdate() == null ? "null" :
toUtcTimeyyyyMMddhhmmssZ(crl.getNextUpdate().getDate());
}
return null;
}
示例4: readDERCRL
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private CRL readDERCRL(
InputStream in)
throws IOException, CRLException
{
ASN1InputStream dIn = new ASN1InputStream(in);
ASN1Sequence seq = (ASN1Sequence)dIn.readObject();
if (seq.size() > 1
&& seq.getObjectAt(0) instanceof ASN1ObjectIdentifier)
{
if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
{
sData = new SignedData(ASN1Sequence.getInstance(
(ASN1TaggedObject)seq.getObjectAt(1), true)).getCRLs();
return getCRL();
}
}
return new X509CRLObject(CertificateList.getInstance(seq));
}
示例5: generateCRLStructure
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private static CertificateList generateCRLStructure(TBSCertList tbsCertList, AlgorithmIdentifier sigAlgId, byte[] signature)
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(tbsCertList);
v.add(sigAlgId);
v.add(new DERBitString(signature));
return CertificateList.getInstance(new DERSequence(v));
}
示例6: getCRL
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private CRL getCRL()
throws CRLException
{
if (sData == null || sDataObjectCount >= sData.size())
{
return null;
}
return new X509CRLObject(
CertificateList.getInstance(
sData.getObjectAt(sDataObjectCount++)));
}
示例7: readPEMCRL
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private CRL readPEMCRL(
InputStream in)
throws IOException, CRLException
{
ASN1Sequence seq = PEM_PARSER.readPEMObject(in);
if (seq != null)
{
return new X509CRLObject(CertificateList.getInstance(seq));
}
return null;
}
示例8: RevocationValues
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private RevocationValues(ASN1Sequence seq)
{
if (seq.size() > 3)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
DERTaggedObject o = (DERTaggedObject)e.nextElement();
switch (o.getTagNo())
{
case 0:
ASN1Sequence crlValsSeq = (ASN1Sequence)o.getObject();
Enumeration crlValsEnum = crlValsSeq.getObjects();
while (crlValsEnum.hasMoreElements())
{
CertificateList.getInstance(crlValsEnum.nextElement());
}
this.crlVals = crlValsSeq;
break;
case 1:
ASN1Sequence ocspValsSeq = (ASN1Sequence)o.getObject();
Enumeration ocspValsEnum = ocspValsSeq.getObjects();
while (ocspValsEnum.hasMoreElements())
{
BasicOCSPResponse.getInstance(ocspValsEnum.nextElement());
}
this.ocspVals = ocspValsSeq;
break;
case 2:
this.otherRevVals = OtherRevVals.getInstance(o.getObject());
break;
default:
throw new IllegalArgumentException("invalid tag: "
+ o.getTagNo());
}
}
}
示例9: getCrlVals
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
public CertificateList[] getCrlVals()
{
if (null == this.crlVals)
{
return new CertificateList[0];
}
CertificateList[] result = new CertificateList[this.crlVals.size()];
for (int idx = 0; idx < result.length; idx++)
{
result[idx] = CertificateList.getInstance(this.crlVals
.getObjectAt(idx));
}
return result;
}
示例10: TimeStampAndCRL
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
private TimeStampAndCRL(ASN1Sequence seq)
{
this.timeStamp = ContentInfo.getInstance(seq.getObjectAt(0));
if (seq.size() == 2)
{
this.crl = CertificateList.getInstance(seq.getObjectAt(1));
}
}
示例11: getCertificateLists
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
public CertificateList[] getCertificateLists()
{
CertificateList[] result = new CertificateList[content.size()];
for (int i = 0; i != result.length; i++)
{
result[i] = CertificateList.getInstance(content.getObjectAt(i));
}
return result;
}
示例12: CertEtcToken
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的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);
}
}
示例13: getBcCrl
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
public CertificateList getBcCrl(BigInteger crlNumber) throws OperationException {
LOG.info(" START getCrl: ca={}, crlNumber={}", caIdent, crlNumber);
boolean successful = false;
try {
byte[] encodedCrl = certstore.getEncodedCrl(caIdent, crlNumber);
if (encodedCrl == null) {
return null;
}
try {
CertificateList crl = CertificateList.getInstance(encodedCrl);
successful = true;
if (LOG.isInfoEnabled()) {
LOG.info("SUCCESSFUL getCrl: ca={}, thisUpdate={}", caIdent,
crl.getThisUpdate().getTime());
}
return crl;
} catch (RuntimeException ex) {
throw new OperationException(ErrorCode.SYSTEM_FAILURE, ex);
}
} finally {
if (!successful) {
LOG.info(" FAILED getCrl: ca={}", caIdent);
}
}
}
示例14: testBeIDPKIValidationCRLOnly
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
@Test
public void testBeIDPKIValidationCRLOnly() throws Exception {
PcscEid pcscEid = new PcscEid(new TestView(), this.messages);
if (false == pcscEid.isEidPresent()) {
LOG.debug("insert eID card");
pcscEid.waitForEidPresent();
}
List<X509Certificate> certChain;
try {
certChain = pcscEid.getSignCertificateChain();
} finally {
pcscEid.close();
}
LOG.debug("certificate: " + certChain.get(0));
NetworkConfig networkConfig = new NetworkConfig("proxy.yourict.net", 8080);
MemoryCertificateRepository memoryCertificateRepository = new MemoryCertificateRepository();
X509Certificate rootCaCertificate = loadCertificate("be/fedict/trust/belgiumrca.crt");
memoryCertificateRepository.addTrustPoint(rootCaCertificate);
X509Certificate rootCa2Certificate = loadCertificate("be/fedict/trust/belgiumrca2.crt");
memoryCertificateRepository.addTrustPoint(rootCa2Certificate);
RevocationData revocationData = new RevocationData();
TrustValidator trustValidator = new TrustValidator(memoryCertificateRepository);
trustValidator.setRevocationData(revocationData);
trustValidator.addTrustLinker(new PublicKeyTrustLinker());
OnlineCrlRepository crlRepository = new OnlineCrlRepository(networkConfig);
trustValidator.addTrustLinker(new CrlTrustLinker(crlRepository));
try {
trustValidator.isTrusted(certChain);
} catch (Exception e) {
LOG.warn("error: " + e.getMessage());
}
byte[] crlData = revocationData.getCrlRevocationData().get(1).getData();
CertificateList certificateList = CertificateList.getInstance(new ASN1InputStream(crlData).readObject());
X509Extensions crlExtensions = certificateList.getTBSCertList().getExtensions();
Enumeration<DERObjectIdentifier> oids = crlExtensions.oids();
while (oids.hasMoreElements()) {
LOG.debug("oid type: " + oids.nextElement().getId());
}
}
示例15: JcaX509CRLHolder
import org.bouncycastle.asn1.x509.CertificateList; //导入方法依赖的package包/类
/**
* Base constructor.
*
* @param crl CRL to be used a the source for the holder creation.
* @throws CRLException if there is a problem extracting the CRL information.
*/
public JcaX509CRLHolder(X509CRL crl)
throws CRLException
{
super(CertificateList.getInstance(crl.getEncoded()));
}