本文整理汇总了Java中org.bouncycastle.asn1.x509.PolicyInformation.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java PolicyInformation.getInstance方法的具体用法?Java PolicyInformation.getInstance怎么用?Java PolicyInformation.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.x509.PolicyInformation
的用法示例。
在下文中一共展示了PolicyInformation.getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPolicies
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的package包/类
public PolicyInformation[] getPolicies()
{
if (policies == null)
{
return null;
}
PolicyInformation[] ps = new PolicyInformation[policies.size()];
for (int i = 0; i != policies.size(); i++)
{
ps[i] = PolicyInformation.getInstance(policies.getObjectAt(i));
}
return ps;
}
示例2: getPolicies
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的package包/类
public PolicyInformation[] getPolicies()
{
if (policies == null)
{
return null;
}
PolicyInformation[] ps = new PolicyInformation[policies.size()];
for (int i = 0; i != policies.size(); i++)
{
ps[i] = PolicyInformation.getInstance(policies.getObjectAt(i));
}
return ps;
}
示例3: fromSequence
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的package包/类
private static PolicyInformation[] fromSequence(ASN1Sequence seq)
{
PolicyInformation[] tmp = new PolicyInformation[seq.size()];
for (int i = 0; i != tmp.length; i++)
{
tmp[i] = PolicyInformation.getInstance(seq.getObjectAt(i));
}
return tmp;
}
示例4: getPolicies
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的package包/类
public PolicyInformation[] getPolicies()
{
if (policies == null)
{
return null;
}
PolicyInformation[] policyInformations = new PolicyInformation[policies.size()];
for (int i = 0; i != policies.size(); i++)
{
policyInformations[i] = PolicyInformation.getInstance(policies.getObjectAt(i));
}
return policyInformations;
}
示例5: getPolicyIdentifiers
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的package包/类
public static List<String> getPolicyIdentifiers(final CertificateToken certToken) {
List<String> policyIdentifiers = new ArrayList<String>();
final byte[] certificatePolicies = certToken.getCertificate().getExtensionValue(Extension.certificatePolicies.getId());
if (certificatePolicies != null) {
ASN1Sequence seq = getAsn1SequenceFromDerOctetString(certificatePolicies);
for (int ii = 0; ii < seq.size(); ii++) {
final PolicyInformation policyInfo = PolicyInformation.getInstance(seq.getObjectAt(ii));
policyIdentifiers.add(policyInfo.getPolicyIdentifier().getId());
}
}
return policyIdentifiers;
}
示例6: check
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的package包/类
@Override
public void check(X509Certificate certificate)
throws TrustLinkerResultException, Exception {
byte[] extensionValue = certificate
.getExtensionValue(Extension.certificatePolicies.getId());
if (null == extensionValue) {
throw new TrustLinkerResultException(
TrustLinkerResultReason.CONSTRAINT_VIOLATION,
"missing certificate policies X509 extension");
}
DEROctetString oct = (DEROctetString) (new ASN1InputStream(
new ByteArrayInputStream(extensionValue)).readObject());
ASN1Sequence certPolicies = (ASN1Sequence) new ASN1InputStream(
oct.getOctets()).readObject();
Enumeration<?> certPoliciesEnum = certPolicies.getObjects();
while (certPoliciesEnum.hasMoreElements()) {
PolicyInformation policyInfo = PolicyInformation
.getInstance(certPoliciesEnum.nextElement());
ASN1ObjectIdentifier policyOid = policyInfo.getPolicyIdentifier();
String policyId = policyOid.getId();
LOG.debug("present policy OID: " + policyId);
if (this.certificatePolicies.contains(policyId)) {
LOG.debug("matching certificate policy OID: " + policyId);
return;
}
}
throw new TrustLinkerResultException(
TrustLinkerResultReason.CONSTRAINT_VIOLATION,
"required policy OID not present");
}
示例7: DVCSRequestInformation
import org.bouncycastle.asn1.x509.PolicyInformation; //导入方法依赖的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++;
}
}