当前位置: 首页>>代码示例>>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;未经允许,请勿转载。