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


Java ASN1OctetString.getInstance方法代碼示例

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


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

示例1: CertResponse

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private CertResponse(ASN1Sequence seq)
{
    certReqId = ASN1Integer.getInstance(seq.getObjectAt(0));
    status = PKIStatusInfo.getInstance(seq.getObjectAt(1));

    if (seq.size() >= 3)
    {
        if (seq.size() == 3)
        {
            ASN1Encodable o = seq.getObjectAt(2);
            if (o instanceof ASN1OctetString)
            {
                rspInfo = ASN1OctetString.getInstance(o);
            }
            else
            {
                certifiedKeyPair = CertifiedKeyPair.getInstance(o);
            }
        }
        else
        {
            certifiedKeyPair = CertifiedKeyPair.getInstance(seq.getObjectAt(2));
            rspInfo = ASN1OctetString.getInstance(seq.getObjectAt(3));
        }
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:27,代碼來源:CertResponse.java

示例2: BCGOST3410PrivateKey

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
BCGOST3410PrivateKey(
    PrivateKeyInfo info)
    throws IOException
{
    GOST3410PublicKeyAlgParameters    params = new GOST3410PublicKeyAlgParameters((ASN1Sequence)info.getAlgorithmId().getParameters());
    ASN1OctetString      derX = ASN1OctetString.getInstance(info.parsePrivateKey());
    byte[]              keyEnc = derX.getOctets();
    byte[]              keyBytes = new byte[keyEnc.length];
    
    for (int i = 0; i != keyEnc.length; i++)
    {
        keyBytes[i] = keyEnc[keyEnc.length - 1 - i]; // was little endian
    }
    
    this.x = new BigInteger(1, keyBytes);
    this.gost3410Spec = GOST3410ParameterSpec.fromPublicKeyAlg(params);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:BCGOST3410PrivateKey.java

示例3: PKIArchiveOptions

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private PKIArchiveOptions(ASN1TaggedObject tagged)
{
    switch (tagged.getTagNo())
    {
    case encryptedPrivKey:
        value = EncryptedKey.getInstance(tagged.getObject());
        break;
    case keyGenParameters:
        value = ASN1OctetString.getInstance(tagged, false);
        break;
    case archiveRemGenPrivKey:
        value = ASN1Boolean.getInstance(tagged, false);
        break;
    default:
        throw new IllegalArgumentException("unknown tag number: " + tagged.getTagNo());
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:PKIArchiveOptions.java

示例4: KeyTransRecipientInformation

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
KeyTransRecipientInformation(
    KeyTransRecipientInfo   info,
    AlgorithmIdentifier     messageAlgorithm,
    CMSSecureReadable       secureReadable,
    AuthAttributesProvider  additionalData)
{
    super(info.getKeyEncryptionAlgorithm(), messageAlgorithm, secureReadable, additionalData);

    this.info = info;

    RecipientIdentifier r = info.getRecipientIdentifier();

    if (r.isTagged())
    {
        ASN1OctetString octs = ASN1OctetString.getInstance(r.getId());

        rid = new KeyTransRecipientId(octs.getOctets());
    }
    else
    {
        IssuerAndSerialNumber   iAnds = IssuerAndSerialNumber.getInstance(r.getId());

        rid = new KeyTransRecipientId(iAnds.getName(), iAnds.getSerialNumber().getValue());
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:26,代碼來源:KeyTransRecipientInformation.java

示例5: EncryptedContentInfo

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的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

示例6: getInstance

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public static DSTU4145PublicKey getInstance(Object obj)
{
    if (obj instanceof DSTU4145PublicKey)
    {
        return (DSTU4145PublicKey)obj;
    }

    if (obj != null)
    {
        return new DSTU4145PublicKey(ASN1OctetString.getInstance(obj));
    }

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

示例7: getInstance

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public static SubjectKeyIdentifier getInstance(
    Object obj)
{
    if (obj instanceof SubjectKeyIdentifier)
    {
        return (SubjectKeyIdentifier)obj;
    }
    else if (obj != null)
    {
        return new SubjectKeyIdentifier(ASN1OctetString.getInstance(obj));
    }

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

示例8: Challenge

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

    if (seq.size() == 3)
    {
        owf = AlgorithmIdentifier.getInstance(seq.getObjectAt(index++));
    }

    witness = ASN1OctetString.getInstance(seq.getObjectAt(index++));
    challenge = ASN1OctetString.getInstance(seq.getObjectAt(index));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:13,代碼來源:Challenge.java

示例9: EncryptedValue

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private EncryptedValue(ASN1Sequence seq)
{
    int index = 0;
    while (seq.getObjectAt(index) instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject tObj = (ASN1TaggedObject)seq.getObjectAt(index);

        switch (tObj.getTagNo())
        {
        case 0:
            intendedAlg = AlgorithmIdentifier.getInstance(tObj, false);
            break;
        case 1:
            symmAlg = AlgorithmIdentifier.getInstance(tObj, false);
            break;
        case 2:
            encSymmKey = DERBitString.getInstance(tObj, false);
            break;
        case 3:
            keyAlg = AlgorithmIdentifier.getInstance(tObj, false);
            break;
        case 4:
            valueHint = ASN1OctetString.getInstance(tObj, false);
            break;
        }
        index++;
    }

    encValue = DERBitString.getInstance(seq.getObjectAt(index));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:31,代碼來源:EncryptedValue.java

示例10: ESSCertID

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
/**
 * constructor
 */
private ESSCertID(ASN1Sequence seq)
{
    if (seq.size() < 1 || seq.size() > 2)
    {
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }

    certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
 
    if (seq.size() > 1)
    {
        issuerSerial = IssuerSerial.getInstance(seq.getObjectAt(1));
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:ESSCertID.java

示例11: getContent

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public ASN1OctetString getContent()
{
    if (data.size() == 3)
    {
        ASN1TaggedObject o = ASN1TaggedObject.getInstance(data.getObjectAt(2));

        return ASN1OctetString.getInstance(o, false);
    }

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

示例12: SignerInformation

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
SignerInformation(
    SignerInfo          info,
    ASN1ObjectIdentifier contentType,
    CMSProcessable      content,
    byte[]              resultDigest)
{
    this.info = info;
    this.contentType = contentType;
    this.isCounterSignature = contentType == null;

    SignerIdentifier   s = info.getSID();

    if (s.isTagged())
    {
        ASN1OctetString octs = ASN1OctetString.getInstance(s.getId());

        sid = new SignerId(octs.getOctets());
    }
    else
    {
        IssuerAndSerialNumber   iAnds = IssuerAndSerialNumber.getInstance(s.getId());

        sid = new SignerId(iAnds.getName(), iAnds.getSerialNumber().getValue());
    }

    this.digestAlgorithm = info.getDigestAlgorithm();
    this.signedAttributeSet = info.getAuthenticatedAttributes();
    this.unsignedAttributeSet = info.getUnauthenticatedAttributes();
    this.encryptionAlgorithm = info.getDigestEncryptionAlgorithm();
    this.signature = info.getEncryptedDigest().getOctets();

    this.content = content;
    this.resultDigest = resultDigest;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:35,代碼來源:SignerInformation.java

示例13: getMac

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

    ASN1Encodable o = nextObject;
    nextObject = null;

    return ASN1OctetString.getInstance(o.toASN1Primitive());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:14,代碼來源:AuthenticatedDataParser.java

示例14: CertStatus

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private CertStatus(ASN1Sequence seq)
{
    certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
    certReqId = ASN1Integer.getInstance(seq.getObjectAt(1));

    if (seq.size() > 2)
    {
        statusInfo = PKIStatusInfo.getInstance(seq.getObjectAt(2));
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:11,代碼來源:CertStatus.java

示例15: getId

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public ASN1Encodable getId()
{
    if (id instanceof ASN1TaggedObject)
    {
        return ASN1OctetString.getInstance((ASN1TaggedObject)id, false);
    }

    return id;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:10,代碼來源:SignerIdentifier.java


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