當前位置: 首頁>>代碼示例>>Java>>正文


Java AlgorithmIdentifier.getInstance方法代碼示例

本文整理匯總了Java中org.bouncycastle.asn1.x509.AlgorithmIdentifier.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java AlgorithmIdentifier.getInstance方法的具體用法?Java AlgorithmIdentifier.getInstance怎麽用?Java AlgorithmIdentifier.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bouncycastle.asn1.x509.AlgorithmIdentifier的用法示例。


在下文中一共展示了AlgorithmIdentifier.getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: OOBCertHash

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private OOBCertHash(ASN1Sequence seq)
{
    int index = seq.size() - 1;

    hashVal = DERBitString.getInstance(seq.getObjectAt(index--));

    for (int i = index; i >= 0; i--)
    {
        ASN1TaggedObject tObj = (ASN1TaggedObject)seq.getObjectAt(i);

        if (tObj.getTagNo() == 0)
        {
            hashAlg = AlgorithmIdentifier.getInstance(tObj, true);
        }
        else
        {
            certId = CertId.getInstance(tObj, true);
        }
    }

}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:22,代碼來源:OOBCertHash.java

示例2: getDigestAlgorithm

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public AlgorithmIdentifier getDigestAlgorithm()
    throws IOException
{
    if (nextObject == null)
    {
        nextObject = seq.readObject();
    }

    if (nextObject instanceof ASN1TaggedObjectParser)
    {
        AlgorithmIdentifier obj = AlgorithmIdentifier.getInstance((ASN1TaggedObject)nextObject.toASN1Primitive(), false);
        nextObject = null;
        return obj;
    }

    return null;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:AuthenticatedDataParser.java

示例3: POPOSigningKey

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private POPOSigningKey(ASN1Sequence seq)
{
    int index = 0;

    if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject tagObj
            = (ASN1TaggedObject)seq.getObjectAt(index++);
        if (tagObj.getTagNo() != 0)
        {
            throw new IllegalArgumentException(
                "Unknown POPOSigningKeyInput tag: " + tagObj.getTagNo());
        }
        poposkInput = POPOSigningKeyInput.getInstance(tagObj.getObject());
    }
    algorithmIdentifier = AlgorithmIdentifier.getInstance(seq.getObjectAt(index++));
    signature = DERBitString.getInstance(seq.getObjectAt(index));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:19,代碼來源:POPOSigningKey.java

示例4: EncryptedContentInfo

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private EncryptedContentInfo(
    ASN1Sequence seq)
{
    if (seq.size() < 2)
    {
        throw new IllegalArgumentException("Truncated Sequence Found");
    }

    contentType = (ASN1ObjectIdentifier)seq.getObjectAt(0);
    contentEncryptionAlgorithm = AlgorithmIdentifier.getInstance(
                                                    seq.getObjectAt(1));
    if (seq.size() > 2)
    {
        encryptedContent = ASN1OctetString.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(2), false);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:EncryptedContentInfo.java

示例5: PrivateKeyInfo

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
/**
 * @deprectaed use PrivateKeyInfo.getInstance()
 * @param seq
 */
public PrivateKeyInfo(
    ASN1Sequence  seq)
{
    Enumeration e = seq.getObjects();

    BigInteger  version = ((ASN1Integer)e.nextElement()).getValue();
    if (version.intValue() != 0)
    {
        throw new IllegalArgumentException("wrong version for private key info");
    }

    algId = AlgorithmIdentifier.getInstance(e.nextElement());
    privKey = ASN1OctetString.getInstance(e.nextElement());
    
    if (e.hasMoreElements())
    {
       attributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:PrivateKeyInfo.java

示例6: getMacAlgorithm

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public AlgorithmIdentifier getMacAlgorithm()
    throws IOException
{
    if (nextObject == null)
    {
        nextObject = seq.readObject();
    }

    if (nextObject != null)
    {
        ASN1SequenceParser o = (ASN1SequenceParser)nextObject;
        nextObject = null;
        return AlgorithmIdentifier.getInstance(o.toASN1Primitive());
    }

    return null;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:AuthenticatedDataParser.java

示例7: SignedPublicKeyAndChallenge

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public SignedPublicKeyAndChallenge(byte[] bytes)
{
    spkacSeq = toDERSequence(bytes);
    pkac = PublicKeyAndChallenge.getInstance(spkacSeq.getObjectAt(0));
    signatureAlgorithm = 
        AlgorithmIdentifier.getInstance(spkacSeq.getObjectAt(1));
    signature = (DERBitString)spkacSeq.getObjectAt(2);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:9,代碼來源:SignedPublicKeyAndChallenge.java

示例8: KEKRecipientInfo

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public KEKRecipientInfo(
    ASN1Sequence seq)
{
    version = (ASN1Integer)seq.getObjectAt(0);
    kekid = KEKIdentifier.getInstance(seq.getObjectAt(1));
    keyEncryptionAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(2));
    encryptedKey = (ASN1OctetString)seq.getObjectAt(3);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:9,代碼來源:KEKRecipientInfo.java

示例9: OtherHashAlgAndValue

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private OtherHashAlgAndValue(
    ASN1Sequence seq)
{
    if (seq.size() != 2)
    {
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }

    hashAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(0));
    hashValue = ASN1OctetString.getInstance(seq.getObjectAt(1));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:12,代碼來源:OtherHashAlgAndValue.java

示例10: BasicOCSPResponse

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private BasicOCSPResponse(
    ASN1Sequence    seq)
{
    this.tbsResponseData = ResponseData.getInstance(seq.getObjectAt(0));
    this.signatureAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
    this.signature = (DERBitString)seq.getObjectAt(2);

    if (seq.size() > 3)
    {
        this.certs = ASN1Sequence.getInstance((ASN1TaggedObject)seq.getObjectAt(3), true);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:13,代碼來源:BasicOCSPResponse.java

示例11: SignerInfo

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public SignerInfo(
    ASN1Sequence seq)
{
    Enumeration     e = seq.getObjects();

    version = (ASN1Integer)e.nextElement();
    issuerAndSerialNumber = IssuerAndSerialNumber.getInstance(e.nextElement());
    digAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());

    Object obj = e.nextElement();

    if (obj instanceof ASN1TaggedObject)
    {
        authenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)obj, false);

        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());
    }
    else
    {
        authenticatedAttributes = null;
        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(obj);
    }

    encryptedDigest = DEROctetString.getInstance(e.nextElement());

    if (e.hasMoreElements())
    {
        unauthenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false);
    }
    else
    {
        unauthenticatedAttributes = null;
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:35,代碼來源:SignerInfo.java

示例12: DigestedData

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private DigestedData(
    ASN1Sequence seq)
{
    this.version = (ASN1Integer)seq.getObjectAt(0);
    this.digestAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
    this.encapContentInfo = ContentInfo.getInstance(seq.getObjectAt(2));
    this.digest = ASN1OctetString.getInstance(seq.getObjectAt(3));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:9,代碼來源:DigestedData.java

示例13: PBMParameter

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private PBMParameter(ASN1Sequence seq)
{
    salt = ASN1OctetString.getInstance(seq.getObjectAt(0));
    owf = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
    iterationCount = ASN1Integer.getInstance(seq.getObjectAt(2));
    mac = AlgorithmIdentifier.getInstance(seq.getObjectAt(3));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:8,代碼來源:PBMParameter.java

示例14: CertificationRequest

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public CertificationRequest(
    ASN1Sequence seq)
{
    reqInfo = CertificationRequestInfo.getInstance(seq.getObjectAt(0));
    sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
    sigBits = (DERBitString)seq.getObjectAt(2);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:8,代碼來源:CertificationRequest.java

示例15: SignerInfo

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
/**
 * @deprecated use getInstance() method.
 */
public SignerInfo(
    ASN1Sequence seq)
{
    Enumeration     e = seq.getObjects();

    version = (ASN1Integer)e.nextElement();
    sid = SignerIdentifier.getInstance(e.nextElement());
    digAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());

    Object obj = e.nextElement();

    if (obj instanceof ASN1TaggedObject)
    {
        authenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)obj, false);

        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());
    }
    else
    {
        authenticatedAttributes = null;
        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(obj);
    }

    encryptedDigest = DEROctetString.getInstance(e.nextElement());

    if (e.hasMoreElements())
    {
        unauthenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false);
    }
    else
    {
        unauthenticatedAttributes = null;
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:38,代碼來源:SignerInfo.java


注:本文中的org.bouncycastle.asn1.x509.AlgorithmIdentifier.getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。