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


Java GeneralName.uniformResourceIdentifier方法代碼示例

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


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

示例1: getCRLDistUrls

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
protected Vector getCRLDistUrls(CRLDistPoint crlDistPoints)
{
    Vector urls = new Vector();
    
    if (crlDistPoints != null)
    {
        DistributionPoint[] distPoints = crlDistPoints.getDistributionPoints();
        for (int i = 0; i < distPoints.length; i++)
        {
            DistributionPointName dp_name = distPoints[i].getDistributionPoint();
            if (dp_name.getType() == DistributionPointName.FULL_NAME)
            {
                GeneralName[] generalNames = GeneralNames.getInstance(dp_name.getName()).getNames();
                for (int j = 0; j < generalNames.length; j++)
                {
                    if (generalNames[j].getTagNo() == GeneralName.uniformResourceIdentifier)
                    {
                        String url = ((DERIA5String) generalNames[j].getName()).getString();
                        urls.add(url);
                    }
                }
            }
        }
    }
    return urls;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:27,代碼來源:PKIXCertPathReviewer.java

示例2: getOCSPUrls

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
protected Vector getOCSPUrls(AuthorityInformationAccess authInfoAccess)
{
    Vector urls = new Vector();
    
    if (authInfoAccess != null)
    {
        AccessDescription[] ads = authInfoAccess.getAccessDescriptions();
        for (int i = 0; i < ads.length; i++)
        {
            if (ads[i].getAccessMethod().equals(AccessDescription.id_ad_ocsp))
            {
                GeneralName name = ads[i].getAccessLocation();
                if (name.getTagNo() == GeneralName.uniformResourceIdentifier)
                {
                    String url = ((DERIA5String) name.getName()).getString();
                    urls.add(url);
                }
            }
        }
    }
    
    return urls;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:PKIXCertPathReviewer.java

示例3: CRLDistributionPointsImpl

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
public CRLDistributionPointsImpl(X509Certificate cert) throws CertificateException, IOException {
	URINames = new ArrayList<>();
	byte[] extVal = cert.getExtensionValue(Extension.cRLDistributionPoints.getId());
	if (extVal == null)
		return;
	CRLDistPoint crlDistPoint = CRLDistPoint.getInstance(X509ExtensionUtil.fromExtensionValue(extVal));
	DistributionPoint[] points = crlDistPoint.getDistributionPoints();
	for (DistributionPoint p : points) {
		GeneralNames tmp = p.getCRLIssuer();
		if (tmp != null) {
			GeneralName[] crlIssers = tmp.getNames();
			for (int i = 0; i < crlIssers.length; i++) {
				if (crlIssers[i].getTagNo() == GeneralName.uniformResourceIdentifier) {
					String issuerUrl = crlIssers[i].toString();
					URINames.add(issuerUrl);
				}
			}
		}
	}
}
 
開發者ID:Catherine22,項目名稱:SecuritySample,代碼行數:21,代碼來源:CRLDistributionPointsImpl.java

示例4: getAlternativeNames

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private static Collection getAlternativeNames(byte[] extVal)
    throws CertificateParsingException
{
    if (extVal == null)
    {
        return Collections.EMPTY_LIST;
    }
    try
    {
        Collection temp = new ArrayList();
        Enumeration it = DERSequence.getInstance(fromExtensionValue(extVal)).getObjects();
        while (it.hasMoreElements())
        {
            GeneralName genName = GeneralName.getInstance(it.nextElement());
            List list = new ArrayList();
            list.add(Integers.valueOf(genName.getTagNo()));
            switch (genName.getTagNo())
            {
            case GeneralName.ediPartyName:
            case GeneralName.x400Address:
            case GeneralName.otherName:
                list.add(genName.getName().toASN1Primitive());
                break;
            case GeneralName.directoryName:
                list.add(X500Name.getInstance(genName.getName()).toString());
                break;
            case GeneralName.dNSName:
            case GeneralName.rfc822Name:
            case GeneralName.uniformResourceIdentifier:
                list.add(((ASN1String)genName.getName()).getString());
                break;
            case GeneralName.registeredID:
                list.add(ASN1ObjectIdentifier.getInstance(genName.getName()).getId());
                break;
            case GeneralName.iPAddress:
                list.add(DEROctetString.getInstance(genName.getName()).getOctets());
                break;
            default:
                throw new IOException("Bad tag number: " + genName.getTagNo());
            }

            temp.add(list);
        }
        return Collections.unmodifiableCollection(temp);
    }
    catch (Exception e)
    {
        throw new CertificateParsingException(e.getMessage());
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:51,代碼來源:X509ExtensionUtil.java

示例5: addAdditionalStoresFromCRLDistributionPoint

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
protected static void addAdditionalStoresFromCRLDistributionPoint(
    CRLDistPoint crldp, ExtendedPKIXParameters pkixParams)
    throws AnnotatedException
{
    if (crldp != null)
    {
        DistributionPoint dps[] = null;
        try
        {
            dps = crldp.getDistributionPoints();
        }
        catch (Exception e)
        {
            throw new AnnotatedException(
                "Distribution points could not be read.", e);
        }
        for (int i = 0; i < dps.length; i++)
        {
            DistributionPointName dpn = dps[i].getDistributionPoint();
            // look for URIs in fullName
            if (dpn != null)
            {
                if (dpn.getType() == DistributionPointName.FULL_NAME)
                {
                    GeneralName[] genNames = GeneralNames.getInstance(
                        dpn.getName()).getNames();
                    // look for an URI
                    for (int j = 0; j < genNames.length; j++)
                    {
                        if (genNames[j].getTagNo() == GeneralName.uniformResourceIdentifier)
                        {
                            String location = DERIA5String.getInstance(
                                genNames[j].getName()).getString();
                            CertPathValidatorUtilities
                                .addAdditionalStoreFromLocation(location,
                                    pkixParams);
                        }
                    }
                }
            }
        }
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:44,代碼來源:CertPathValidatorUtilities.java


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