當前位置: 首頁>>代碼示例>>Java>>正文


Java X509Extensions.oids方法代碼示例

本文整理匯總了Java中org.bouncycastle.asn1.x509.X509Extensions.oids方法的典型用法代碼示例。如果您正苦於以下問題:Java X509Extensions.oids方法的具體用法?Java X509Extensions.oids怎麽用?Java X509Extensions.oids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bouncycastle.asn1.x509.X509Extensions的用法示例。


在下文中一共展示了X509Extensions.oids方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(boolean critical)
{
    Set             set = new HashSet();
    X509Extensions  extensions = this.getResponseExtensions();
    
    if (extensions != null)
    {
        Enumeration     e = extensions.oids();

        while (e.hasMoreElements())
        {
            DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
            X509Extension       ext = extensions.getExtension(oid);

            if (critical == ext.isCritical())
            {
                set.add(oid.getId());
            }
        }
    }

    return set;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:RespData.java

示例2: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(boolean critical)
{
    Set             set = new HashSet();
    X509Extensions  extensions = this.getRequestExtensions();
    
    if (extensions != null)
    {
        Enumeration     e = extensions.oids();

        while (e.hasMoreElements())
        {
            ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)e.nextElement();
            X509Extension       ext = extensions.getExtension(oid);

            if (critical == ext.isCritical())
            {
                set.add(oid.getId());
            }
        }
    }

    return set;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:OCSPReq.java

示例3: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(boolean critical)
{
    Set             set = new HashSet();
    X509Extensions  extensions = this.getSingleRequestExtensions();
    
    if (extensions != null)
    {
        Enumeration     e = extensions.oids();

        while (e.hasMoreElements())
        {
            DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
            X509Extension       ext = extensions.getExtension(oid);

            if (critical == ext.isCritical())
            {
                set.add(oid.getId());
            }
        }
    }

    return set;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:Req.java

示例4: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(boolean critical)
{
    Set             set = new HashSet();
    X509Extensions  extensions = this.getSingleExtensions();
    
    if (extensions != null)
    {
        Enumeration     e = extensions.oids();

        while (e.hasMoreElements())
        {
            DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
            X509Extension       ext = extensions.getExtension(oid);

            if (critical == ext.isCritical())
            {
                set.add(oid.getId());
            }
        }
    }

    return set;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:SingleResp.java

示例5: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(
    boolean critical) 
{
    X509Extensions  extensions = cert.getAcinfo().getExtensions();

    if (extensions != null)
    {
        Set             set = new HashSet();
        Enumeration     e = extensions.oids();

        while (e.hasMoreElements())
        {
            DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
            X509Extension       ext = extensions.getExtension(oid);

            if (ext.isCritical() == critical)
            {
                set.add(oid.getId());
            }
        }

        return set;
    }

    return null;
}
 
開發者ID:thangbn,項目名稱:Direct-File-Downloader,代碼行數:27,代碼來源:X509V2AttributeCertificate.java

示例6: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(boolean critical)
{
	if (this.getVersion() == 2)
	{
		HashSet         set = new HashSet();
		X509Extensions  extensions = c.getTBSCertList().getExtensions();
		Enumeration     e = extensions.oids();

		while (e.hasMoreElements())
		{
			DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
			X509Extension       ext = extensions.getExtension(oid);

			if (critical == ext.isCritical())
			{
				set.add(oid.getId());
			}
		}

		return set;
	}

	return null;
}
 
開發者ID:thangbn,項目名稱:Direct-File-Downloader,代碼行數:25,代碼來源:X509CRLObject.java

示例7: getExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
private Set getExtensionOIDs(boolean critical)
{
	X509Extensions extensions = c.getExtensions();

	if ( extensions != null )
	{
		HashSet			set = new HashSet();
		Enumeration		e = extensions.oids();

		while (e.hasMoreElements())
		{
			DERObjectIdentifier	oid = (DERObjectIdentifier)e.nextElement();
			X509Extension		ext = extensions.getExtension(oid);

			if (critical == ext.isCritical())
			{
				set.add(oid.getId());
			}
		}

		return set;
	}

	return null;
}
 
開發者ID:thangbn,項目名稱:Direct-File-Downloader,代碼行數:26,代碼來源:X509CRLEntryObject.java

示例8: checkUnsupportedCriticalExtensions

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
protected void checkUnsupportedCriticalExtensions(TBSCertificateStructure crt, int certType,
	X509Certificate checkedProxy) throws ProxyPathValidatorException {

	logger.debug("enter: checkUnsupportedCriticalExtensions");

	X509Extensions extensions = crt.getExtensions();
	if (extensions != null) {
		Enumeration e = extensions.oids();
		while (e.hasMoreElements()) {
			DERObjectIdentifier oid = (DERObjectIdentifier) e.nextElement();
			X509Extension ext = extensions.getExtension(oid);
			if (ext.isCritical()) {
				if (oid.equals(X509Extensions.BasicConstraints) || oid.equals(X509Extensions.KeyUsage)
					|| (oid.equals(ProxyCertInfo.OID) && CertUtil.isGsi4Proxy(certType))
					|| (oid.equals(ProxyCertInfo.OLD_OID) && CertUtil.isGsi3Proxy(certType))) {
				} else {
					throw new ProxyPathValidatorException(ProxyPathValidatorException.UNSUPPORTED_EXTENSION,
						checkedProxy, "Unsuppored critical exception : " + oid.getId());
				}
			}
		}
	}

	logger.debug("exit: checkUnsupportedCriticalExtensions");
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:26,代碼來源:ProxyPathValidator.java

示例9: toString

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
public String toString()
{
	StringBuffer buf = new StringBuffer();
	String nl = System.getProperty("line.separator");

	buf.append("      userCertificate: " + this.getSerialNumber() + nl);
	buf.append("       revocationDate: " + this.getRevocationDate() + nl);


	X509Extensions extensions = c.getExtensions();

	if ( extensions != null )
	{
		Enumeration e = extensions.oids();
		if ( e.hasMoreElements() )
		{
			buf.append("   crlEntryExtensions:" + nl);

			while ( e.hasMoreElements() )
			{
				DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
				X509Extension ext = extensions.getExtension(oid);
				buf.append(ext);
			}
		}
	}

	return buf.toString();
}
 
開發者ID:thangbn,項目名稱:Direct-File-Downloader,代碼行數:30,代碼來源:X509CRLEntryObject.java

示例10: getCriticalExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
public Set getCriticalExtensionOIDs() 
{
    if (this.getVersion() == 3)
    {
        HashSet         set = new HashSet();
        X509Extensions  extensions = c.getTBSCertificate().getExtensions();

        if (extensions != null)
        {
            Enumeration     e = extensions.oids();

            while (e.hasMoreElements())
            {
                DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
                X509Extension       ext = extensions.getExtension(oid);

                if (ext.isCritical())
                {
                    set.add(oid.getId());
                }
            }

            return set;
        }
    }

    return null;
}
 
開發者ID:AcademicTorrents,項目名稱:AcademicTorrents-Downloader,代碼行數:29,代碼來源:X509CertificateObject.java

示例11: getNonCriticalExtensionOIDs

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
public Set getNonCriticalExtensionOIDs() 
{
    if (this.getVersion() == 3)
    {
        HashSet         set = new HashSet();
        X509Extensions  extensions = c.getTBSCertificate().getExtensions();

        if (extensions != null)
        {
            Enumeration     e = extensions.oids();

            while (e.hasMoreElements())
            {
                DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
                X509Extension       ext = extensions.getExtension(oid);

                if (!ext.isCritical())
                {
                    set.add(oid.getId());
                }
            }

            return set;
        }
    }

    return null;
}
 
開發者ID:AcademicTorrents,項目名稱:AcademicTorrents-Downloader,代碼行數:29,代碼來源:X509CertificateObject.java

示例12: hasUnsupportedCriticalExtension

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
public boolean hasUnsupportedCriticalExtension()
{
    if (this.getVersion() == 3)
    {
        X509Extensions  extensions = c.getTBSCertificate().getExtensions();

        if (extensions != null)
        {
            Enumeration     e = extensions.oids();

            while (e.hasMoreElements())
            {
                DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
                if (oid.getId().equals("2.5.29.15")
                   || oid.getId().equals("2.5.29.19"))
                {
                    continue;
                }

                X509Extension       ext = extensions.getExtension(oid);

                if (ext.isCritical())
                {
                    return true;
                }
            }
        }
    }

    return false;
}
 
開發者ID:AcademicTorrents,項目名稱:AcademicTorrents-Downloader,代碼行數:32,代碼來源:X509CertificateObject.java

示例13: checkUnsupportedCriticalExtensions

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的package包/類
protected void checkUnsupportedCriticalExtensions(TBSCertificateStructure crt,
					      int certType,
					      X509Certificate checkedProxy) 
throws ProxyPathValidatorException {

logger.debug("enter: checkUnsupportedCriticalExtensions");

X509Extensions extensions = crt.getExtensions();
if (extensions != null) {
    Enumeration e = extensions.oids();
    while (e.hasMoreElements()) {
	DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
	X509Extension ext = extensions.getExtension(oid);
	if (ext.isCritical()) {
	    if (oid.equals(X509Extensions.BasicConstraints) ||
		oid.equals(X509Extensions.KeyUsage) ||
		(oid.equals(ProxyCertInfo.OID) && 
                        CertUtil.isGsi4Proxy(certType)) ||
		(oid.equals(ProxyCertInfo.OLD_OID) && 
                        CertUtil.isGsi3Proxy(certType))) {
	    } else {
		throw new ProxyPathValidatorException(
		      ProxyPathValidatorException
                             .UNSUPPORTED_EXTENSION,
		      checkedProxy,
		      "Unsuppored critical exception : " 
                             + oid.getId());
	    }
	}
    }
}

logger.debug("exit: checkUnsupportedCriticalExtensions");
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:35,代碼來源:ProxyPathValidator.java

示例14: testBeIDPKIValidationCRLOnly

import org.bouncycastle.asn1.x509.X509Extensions; //導入方法依賴的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());
	}
}
 
開發者ID:e-Contract,項目名稱:eid-applet,代碼行數:47,代碼來源:PcscTest.java


注:本文中的org.bouncycastle.asn1.x509.X509Extensions.oids方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。