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


Java PolicyInformation.getInstance方法代码示例

本文整理汇总了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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:OtherSigningCertificate.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:SigningCertificate.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:PathProcInput.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:SigningCertificateV2.java

示例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;
}
 
开发者ID:esig,项目名称:dss,代码行数:13,代码来源:DSSASN1Utils.java

示例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");
}
 
开发者ID:e-Contract,项目名称:jtrust,代码行数:31,代码来源:CertificatePoliciesCertificateConstraint.java

示例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++;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:61,代码来源:DVCSRequestInformation.java


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