当前位置: 首页>>代码示例>>Java>>正文


Java GeneralNames.getInstance方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.x509.GeneralNames.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java GeneralNames.getInstance方法的具体用法?Java GeneralNames.getInstance怎么用?Java GeneralNames.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.x509.GeneralNames的用法示例。


在下文中一共展示了GeneralNames.getInstance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRevokedCertificate

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
public X509CRLEntryHolder getRevokedCertificate(BigInteger serialNumber)
{
    GeneralNames currentCA = issuerName;
    for (Enumeration en = x509CRL.getRevokedCertificateEnumeration(); en.hasMoreElements();)
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)en.nextElement();

        if (entry.getUserCertificate().getValue().equals(serialNumber))
        {
            return new X509CRLEntryHolder(entry, isIndirect, currentCA);
        }

        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                currentCA = GeneralNames.getInstance(currentCaName.getParsedValue());
            }
        }
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:X509CRLHolder.java

示例2: SubjectAlternativeNameImpl

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
public SubjectAlternativeNameImpl(X509Certificate cert) throws IOException {
	DNSNames = new ArrayList<>();
	byte[] extVal = cert.getExtensionValue(Extension.subjectAlternativeName.getId());
	if (extVal == null)
		return;
	GeneralNames gn = GeneralNames.getInstance(X509ExtensionUtil.fromExtensionValue(extVal));
	GeneralName[] names = gn.getNames();
	for (GeneralName name : names) {
		if (name.getTagNo() == GeneralName.dNSName) {
			String dns = name.getName().toString();
			DNSNames.add(dns);
		}
	}
}
 
开发者ID:Catherine22,项目名称:SecuritySample,代码行数:15,代码来源:SubjectAlternativeNameImpl.java

示例3: AttributeCertificateHolder

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
public AttributeCertificateHolder(X509Principal issuerName,
    BigInteger serialNumber)
{
    holder = new org.bouncycastle.asn1.x509.Holder(new IssuerSerial(
        GeneralNames.getInstance(new DERSequence(new GeneralName(issuerName))),
        new ASN1Integer(serialNumber)));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:AttributeCertificateHolder.java

示例4: X509CRLEntryHolder

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
X509CRLEntryHolder(TBSCertList.CRLEntry entry, boolean isIndirect, GeneralNames previousCA)
{
    this.entry = entry;
    this.ca = previousCA;

    if (isIndirect && entry.hasExtensions())
    {
        Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

        if (currentCaName != null)
        {
            ca = GeneralNames.getInstance(currentCaName.getParsedValue());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:16,代码来源:X509CRLEntryHolder.java

示例5: getAdditionalStoresFromAltNames

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
static List<PKIXCertStore> getAdditionalStoresFromAltNames(
    byte[] issuerAlternativeName,
    Map<GeneralName, PKIXCertStore> altNameCertStoreMap)
    throws CertificateParsingException
{
    // if in the IssuerAltName extension an URI
    // is given, add an additional X.509 store
    if (issuerAlternativeName != null)
    {
        GeneralNames issuerAltName = GeneralNames.getInstance(ASN1OctetString.getInstance(issuerAlternativeName).getOctets());

        GeneralName[] names = issuerAltName.getNames();
        List<PKIXCertStore>  stores = new ArrayList<PKIXCertStore>();

        for (int i = 0; i != names.length; i++)
        {
            GeneralName altName = names[i];

            PKIXCertStore altStore = altNameCertStoreMap.get(altName);

            if (altStore != null)
            {
                stores.add(altStore);
            }
        }

        return stores;
    }
    else
    {
        return Collections.EMPTY_LIST;
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:34,代码来源:CertPathValidatorUtilities.java

示例6: AttributeCertificateIssuer

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
public AttributeCertificateIssuer(X509Principal principal)
{
    form = new V2Form(GeneralNames.getInstance(new DERSequence(new GeneralName(principal))));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:AttributeCertificateIssuer.java

示例7: generateGeneralNames

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
private GeneralNames generateGeneralNames(X509Principal principal)
{
    return GeneralNames.getInstance(new DERSequence(new GeneralName(principal)));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:AttributeCertificateHolder.java

示例8: DVCSRequestInformation

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
private DVCSRequestInformation(ASN1Sequence seq)
{
    int i = 0;

    if (seq.getObjectAt(0) instanceof ASN1Integer)
    {
        ASN1Integer encVersion = ASN1Integer.getInstance(seq.getObjectAt(i++));
        this.version = encVersion.getValue().intValue();
    }
    else
    {
        this.version = 1;
    }

    this.service = ServiceType.getInstance(seq.getObjectAt(i++));

    while (i < seq.size())
    {
        ASN1Encodable x = seq.getObjectAt(i);

        if (x instanceof ASN1Integer)
        {
            this.nonce = ASN1Integer.getInstance(x).getValue();
        }
        else if (x instanceof ASN1GeneralizedTime)
        {
            this.requestTime = DVCSTime.getInstance(x);
        }
        else if (x instanceof ASN1TaggedObject)
        {
            ASN1TaggedObject t = ASN1TaggedObject.getInstance(x);
            int tagNo = t.getTagNo();

            switch (tagNo)
            {
            case TAG_REQUESTER:
                this.requester = GeneralNames.getInstance(t, false);
                break;
            case TAG_REQUEST_POLICY:
                this.requestPolicy = PolicyInformation.getInstance(ASN1Sequence.getInstance(t, false));
                break;
            case TAG_DVCS:
                this.dvcs = GeneralNames.getInstance(t, false);
                break;
            case TAG_DATA_LOCATIONS:
                this.dataLocations = GeneralNames.getInstance(t, false);
                break;
            case TAG_EXTENSIONS:
                this.extensions = Extensions.getInstance(t, false);
                break;
            }
        }
        else
        {
            this.requestTime = DVCSTime.getInstance(x);
        }

        i++;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:61,代码来源:DVCSRequestInformation.java

示例9: getAlternativeNames

import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
public GeneralNames getAlternativeNames() {
  Extension encodedAlternativeNames = certificateHolder
      .getExtension(Extension.subjectAlternativeName);
  return encodedAlternativeNames != null ? GeneralNames
      .getInstance(encodedAlternativeNames.getParsedValue()) : null;
}
 
开发者ID:cloudfoundry-incubator,项目名称:credhub,代码行数:7,代码来源:CertificateReader.java


注:本文中的org.bouncycastle.asn1.x509.GeneralNames.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。