當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。