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


Java ASN1Sequence.getInstance方法代码示例

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


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

示例1: getSignatureName

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
static String getSignatureName(
    AlgorithmIdentifier sigAlgId) 
{
    ASN1Encodable params = sigAlgId.getParameters();
    
    if (params != null && !derNull.equals(params))
    {
        if (sigAlgId.getAlgorithm().equals(PKCSObjectIdentifiers.id_RSASSA_PSS))
        {
            RSASSAPSSparams rsaParams = RSASSAPSSparams.getInstance(params);
            
            return getDigestAlgName(rsaParams.getHashAlgorithm().getAlgorithm()) + "withRSAandMGF1";
        }
        if (sigAlgId.getAlgorithm().equals(X9ObjectIdentifiers.ecdsa_with_SHA2))
        {
            ASN1Sequence ecDsaParams = ASN1Sequence.getInstance(params);
            
            return getDigestAlgName((DERObjectIdentifier)ecDsaParams.getObjectAt(0)) + "withECDSA";
        }
    }

    return sigAlgId.getAlgorithm().getId();
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:X509SignatureUtil.java

示例2: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * return a OtherRecipientInfo object from the given object.
 *
 * @param obj the object we want converted.
 * @exception IllegalArgumentException if the object cannot be converted.
 */
public static OtherRecipientInfo getInstance(
    Object obj)
{
    if (obj instanceof OtherRecipientInfo)
    {
        return (OtherRecipientInfo)obj;
    }
    
    if (obj != null)
    {
        return new OtherRecipientInfo(ASN1Sequence.getInstance(obj));
    }
    
    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:OtherRecipientInfo.java

示例3: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static Data getInstance(Object obj)
{
    if (obj instanceof Data)
    {
        return (Data)obj;
    }
    else if (obj instanceof ASN1OctetString)
    {
        return new Data((ASN1OctetString)obj);
    }
    else if (obj instanceof ASN1Sequence)
    {
        return new Data(DigestInfo.getInstance(obj));
    }
    else if (obj instanceof ASN1TaggedObject)
    {
        return new Data(ASN1Sequence.getInstance((ASN1TaggedObject)obj, false));
    }
    throw new IllegalArgumentException("Unknown object submitted to getInstance: " + obj.getClass().getName());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:Data.java

示例4: SignerLocation

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public SignerLocation(
    DERUTF8String   countryName,
    DERUTF8String   localityName,
    ASN1Sequence    postalAddress)
{
    if (postalAddress != null && postalAddress.size() > 6)
    {
        throw new IllegalArgumentException("postal address must contain less than 6 strings");
    }

    if (countryName != null)
    {
        this.countryName = DERUTF8String.getInstance(countryName.toASN1Primitive());
    }

    if (localityName != null)
    {
        this.localityName = DERUTF8String.getInstance(localityName.toASN1Primitive());
    }

    if (postalAddress != null)
    {
        this.postalAddress = ASN1Sequence.getInstance(postalAddress.toASN1Primitive());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:SignerLocation.java

示例5: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static SafeBag getInstance(
    Object  obj)
{
    if (obj instanceof SafeBag)
    {
        return (SafeBag)obj;
    }

    if (obj != null)
    {
        return new SafeBag(ASN1Sequence.getInstance(obj));
    }

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

示例6: intersectDN

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private Set intersectDN(Set permitted, Set dns)
{
    Set intersect = new HashSet();
    for (Iterator it = dns.iterator(); it.hasNext();)
    {
        ASN1Sequence dn = ASN1Sequence.getInstance(((GeneralSubtree)it
            .next()).getBase().getName().toASN1Primitive());
        if (permitted == null)
        {
            if (dn != null)
            {
                intersect.add(dn);
            }
        }
        else
        {
            Iterator _iter = permitted.iterator();
            while (_iter.hasNext())
            {
                ASN1Sequence subtree = (ASN1Sequence)_iter.next();

                if (withinDNSubtree(dn, subtree))
                {
                    intersect.add(dn);
                }
                else if (withinDNSubtree(subtree, dn))
                {
                    intersect.add(subtree);
                }
            }
        }
    }
    return intersect;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:35,代码来源:PKIXNameConstraintValidator.java

示例7: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static RevAnnContent getInstance(Object o)
{
    if (o instanceof RevAnnContent)
    {
        return (RevAnnContent)o;
    }

    if (o != null)
    {
        return new RevAnnContent(ASN1Sequence.getInstance(o));
    }

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

示例8: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static PKMACValue getInstance(Object o)
{
    if (o instanceof PKMACValue)
    {
        return (PKMACValue)o;
    }

    if (o != null)
    {
        return new PKMACValue(ASN1Sequence.getInstance(o));
    }

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

示例9: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static AuthorityInformationAccess getInstance(
    Object  obj)
{
    if (obj instanceof AuthorityInformationAccess)
    {
        return (AuthorityInformationAccess)obj;
    }

    if (obj != null)
    {
        return new AuthorityInformationAccess(ASN1Sequence.getInstance(obj));
    }

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

示例10: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static McElieceCCA2PrivateKey getInstance(Object o)
{
    if (o instanceof McElieceCCA2PrivateKey)
    {
        return (McElieceCCA2PrivateKey)o;
    }
    else if (o != null)
    {
        return new McElieceCCA2PrivateKey(ASN1Sequence.getInstance(o));
    }

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

示例11: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static MacData getInstance(
    Object  obj)
{
    if (obj instanceof MacData)
    {
        return (MacData)obj;
    }
    else if (obj != null)
    {
        return new MacData(ASN1Sequence.getInstance(obj));
    }

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

示例12: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * Creates an instance of a TargetInformation from the given object.
 * <p>
 * <code>obj</code> can be a TargetInformation or a {@link ASN1Sequence}
 * 
 * @param obj The object.
 * @return A TargetInformation instance.
 * @throws IllegalArgumentException if the given object cannot be
 *             interpreted as TargetInformation.
 */
public static TargetInformation getInstance(Object obj)
{
    if (obj instanceof TargetInformation)
    {
        return (TargetInformation)obj;
    }
    else if (obj != null)
    {
        return new TargetInformation(ASN1Sequence.getInstance(obj));
    }

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

示例13: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static CommitmentTypeIndication getInstance(
    Object obj)
{
    if (obj == null || obj instanceof CommitmentTypeIndication)
    {
        return (CommitmentTypeIndication)obj;
    }

    return new CommitmentTypeIndication(ASN1Sequence.getInstance(obj));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:CommitmentTypeIndication.java

示例14: getInstance

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static NoticeReference getInstance(
    Object as) 
{
   if (as instanceof NoticeReference)
   {
       return (NoticeReference)as;
   }
   else if (as != null)
   {
       return new NoticeReference(ASN1Sequence.getInstance(as));
   }

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

示例15: getContentInfos

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * Return the content infos in the AuthenticatedSafe contained in this Pfx.
 *
 * @return an array of ContentInfo.
 */
public ContentInfo[] getContentInfos()
{
    ASN1Sequence seq = ASN1Sequence.getInstance(ASN1OctetString.getInstance(this.pfx.getAuthSafe().getContent()).getOctets());
    ContentInfo[] content = new ContentInfo[seq.size()];

    for (int i = 0; i != seq.size(); i++)
    {
        content[i] = ContentInfo.getInstance(seq.getObjectAt(i));
    }

    return content;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:PKCS12PfxPdu.java


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