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


Java DERSequence.getInstance方法代码示例

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


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

示例1: processCertE

import org.bouncycastle.asn1.DERSequence; //导入方法依赖的package包/类
protected static PKIXPolicyNode processCertE(
    CertPath certPath,
    int index,
    PKIXPolicyNode validPolicyTree)
    throws CertPathValidatorException
{
    List certs = certPath.getCertificates();
    X509Certificate cert = (X509Certificate)certs.get(index);
    // 
    // (e)
    //
    ASN1Sequence certPolicies = null;
    try
    {
        certPolicies = DERSequence.getInstance(CertPathValidatorUtilities.getExtensionValue(cert,
            RFC3280CertPathUtilities.CERTIFICATE_POLICIES));
    }
    catch (AnnotatedException e)
    {
        throw new ExtCertPathValidatorException("Could not read certificate policies extension from certificate.",
            e, certPath, index);
    }
    if (certPolicies == null)
    {
        validPolicyTree = null;
    }
    return validPolicyTree;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:RFC3280CertPathUtilities.java

示例2: prepareNextCertA

import org.bouncycastle.asn1.DERSequence; //导入方法依赖的package包/类
protected static void prepareNextCertA(
    CertPath certPath,
    int index)
    throws CertPathValidatorException
{
    List certs = certPath.getCertificates();
    X509Certificate cert = (X509Certificate)certs.get(index);
    //
    //
    // (a) check the policy mappings
    //
    ASN1Sequence pm = null;
    try
    {
        pm = DERSequence.getInstance(CertPathValidatorUtilities.getExtensionValue(cert,
            RFC3280CertPathUtilities.POLICY_MAPPINGS));
    }
    catch (AnnotatedException ex)
    {
        throw new ExtCertPathValidatorException("Policy mappings extension could not be decoded.", ex, certPath,
            index);
    }
    if (pm != null)
    {
        ASN1Sequence mappings = pm;

        for (int j = 0; j < mappings.size(); j++)
        {
            DERObjectIdentifier issuerDomainPolicy = null;
            DERObjectIdentifier subjectDomainPolicy = null;
            try
            {
                ASN1Sequence mapping = DERSequence.getInstance(mappings.getObjectAt(j));

                issuerDomainPolicy = DERObjectIdentifier.getInstance(mapping.getObjectAt(0));
                subjectDomainPolicy = DERObjectIdentifier.getInstance(mapping.getObjectAt(1));
            }
            catch (Exception e)
            {
                throw new ExtCertPathValidatorException("Policy mappings extension contents could not be decoded.",
                    e, certPath, index);
            }

            if (RFC3280CertPathUtilities.ANY_POLICY.equals(issuerDomainPolicy.getId()))
            {

                throw new CertPathValidatorException("IssuerDomainPolicy is anyPolicy", null, certPath, index);
            }

            if (RFC3280CertPathUtilities.ANY_POLICY.equals(subjectDomainPolicy.getId()))
            {

                throw new CertPathValidatorException("SubjectDomainPolicy is anyPolicy,", null, certPath, index);
            }
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:58,代码来源:RFC3280CertPathUtilities.java

示例3: AdmissionSyntax

import org.bouncycastle.asn1.DERSequence; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p/>
 * The sequence is of type ProcurationSyntax:
 * <p/>
 * <pre>
 *     AdmissionSyntax ::= SEQUENCE
 *     {
 *       admissionAuthority GeneralName OPTIONAL,
 *       contentsOfAdmissions SEQUENCE OF Admissions
 *     }
 * <p/>
 *     Admissions ::= SEQUENCE
 *     {
 *       admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
 *       namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
 *       professionInfos SEQUENCE OF ProfessionInfo
 *     }
 * <p/>
 *     NamingAuthority ::= SEQUENCE
 *     {
 *       namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
 *       namingAuthorityUrl IA5String OPTIONAL,
 *       namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
 *     }
 * <p/>
 *     ProfessionInfo ::= SEQUENCE
 *     {
 *       namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
 *       professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
 *       professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
 *       registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
 *       addProfessionInfo OCTET STRING OPTIONAL
 *     }
 * </pre>
 *
 * @param seq The ASN.1 sequence.
 */
private AdmissionSyntax(ASN1Sequence seq)
{
    switch (seq.size())
    {
    case 1:
        contentsOfAdmissions = DERSequence.getInstance(seq.getObjectAt(0));
        break;
    case 2:
        admissionAuthority = GeneralName.getInstance(seq.getObjectAt(0));
        contentsOfAdmissions = DERSequence.getInstance(seq.getObjectAt(1));
        break;
    default:
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:54,代码来源:AdmissionSyntax.java


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