本文整理汇总了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;
}
示例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);
}
}
}
示例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)));
}
示例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());
}
}
}
示例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;
}
}
示例6: AttributeCertificateIssuer
import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
public AttributeCertificateIssuer(X509Principal principal)
{
form = new V2Form(GeneralNames.getInstance(new DERSequence(new GeneralName(principal))));
}
示例7: generateGeneralNames
import org.bouncycastle.asn1.x509.GeneralNames; //导入方法依赖的package包/类
private GeneralNames generateGeneralNames(X509Principal principal)
{
return GeneralNames.getInstance(new DERSequence(new GeneralName(principal)));
}
示例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++;
}
}
示例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;
}