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


Java ASN1OctetString.getOctets方法代碼示例

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


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

示例1: engineInit

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
protected void engineInit(
    byte[] params)
    throws IOException
{
    //
    // check that we don't have a DER encoded octet string
    //
    if ((params.length % 8) != 0
        && params[0] == 0x04 && params[1] == params.length - 2)
    {
        ASN1OctetString oct = (ASN1OctetString)ASN1Primitive.fromByteArray(params);

        params = oct.getOctets();
    }

    this.iv = Arrays.clone(params);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:IvAlgorithmParameters.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: 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

示例4: digestSecretKey0

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
@Override
protected byte[] digestSecretKey0(long mechanism) throws P11TokenException {
    Asn1P11EntityIdentifier asn1EntityId = new Asn1P11EntityIdentifier(identityId);
    Asn1DigestSecretKeyTemplate template = new Asn1DigestSecretKeyTemplate(
            asn1EntityId, mechanism);
    byte[] result = ((ProxyP11Slot) slot).module().send(
            P11ProxyConstants.ACTION_DIGEST_SECRETKEY, template);

    ASN1OctetString octetString;
    try {
        octetString = DEROctetString.getInstance(result);
    } catch (IllegalArgumentException ex) {
        throw new P11TokenException("the returned result is not OCTET STRING");
    }

    return (octetString == null) ? null : octetString.getOctets();
}
 
開發者ID:xipki,項目名稱:xitk,代碼行數:18,代碼來源:ProxyP11Identity.java

示例5: setBasePointG

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private void setBasePointG(ASN1OctetString basePointG)
    throws IllegalArgumentException
{
    if ((options & G) == 0)
    {
        options |= G;
        this.basePointG = basePointG.getOctets();
    }
    else
    {
        throw new IllegalArgumentException("Base Point G already set");
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:14,代碼來源:ECDSAPublicKey.java

示例6: setPublicPointY

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private void setPublicPointY(ASN1OctetString publicPointY)
    throws IllegalArgumentException
{
    if ((options & Y) == 0)
    {
        options |= Y;
        this.publicPointY = publicPointY.getOctets();
    }
    else
    {
        throw new IllegalArgumentException("Public Point Y already set");
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:14,代碼來源:ECDSAPublicKey.java

示例7: getKeyHash

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public byte[] getKeyHash()
{
    if (this.value instanceof ASN1OctetString)
    {
        ASN1OctetString octetString = (ASN1OctetString)this.value;
        return octetString.getOctets();
    }

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

示例8: 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

示例9: sign0

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
@Override
protected byte[] sign0(long mechanism, P11Params parameters, byte[] content)
        throws P11TokenException {
    Asn1P11EntityIdentifier asn1EntityId = new Asn1P11EntityIdentifier(identityId);
    Asn1P11Params p11Param = null;
    if (parameters instanceof P11RSAPkcsPssParams) {
        p11Param = new Asn1P11Params(
                new Asn1RSAPkcsPssParams((P11RSAPkcsPssParams) parameters));
    } else if (parameters instanceof P11ByteArrayParams) {
        byte[] bytes = ((P11ByteArrayParams) parameters).getBytes();
        p11Param = new Asn1P11Params(new DEROctetString(bytes));
    }

    Asn1SignTemplate signTemplate = new Asn1SignTemplate(asn1EntityId, mechanism, p11Param,
            content);
    byte[] result = ((ProxyP11Slot) slot).module().send(P11ProxyConstants.ACTION_SIGN,
            signTemplate);

    ASN1OctetString octetString;
    try {
        octetString = DEROctetString.getInstance(result);
    } catch (IllegalArgumentException ex) {
        throw new P11TokenException("the returned result is not OCTET STRING");
    }

    return (octetString == null) ? null : octetString.getOctets();
}
 
開發者ID:xipki,項目名稱:xitk,代碼行數:28,代碼來源:ProxyP11Identity.java

示例10: getKey

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public BigInteger getKey()
{
    ASN1OctetString octs = (ASN1OctetString)seq.getObjectAt(1);

    return new BigInteger(1, octs.getOctets());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:7,代碼來源:ECPrivateKey.java

示例11: getKey

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public BigInteger getKey()
{
    ASN1OctetString  octs = (ASN1OctetString)seq.getObjectAt(1);

    return new BigInteger(1, octs.getOctets());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:7,代碼來源:ECPrivateKeyStructure.java

示例12: SubjectKeyIdentifier

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
protected SubjectKeyIdentifier(
    ASN1OctetString keyid)
{
    this.keyidentifier = keyid.getOctets();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:6,代碼來源:SubjectKeyIdentifier.java

示例13: X9FieldElement

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public X9FieldElement(BigInteger p, ASN1OctetString s)
{
    this(new ECFieldElement.Fp(p, new BigInteger(1, s.getOctets())));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:5,代碼來源:X9FieldElement.java

示例14: OriginatorIdentifierOrKey

import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
/**
 * @deprecated use version taking a SubjectKeyIdentifier
 */
public OriginatorIdentifierOrKey(
    ASN1OctetString id)
{
    this(new SubjectKeyIdentifier(id.getOctets()));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:9,代碼來源:OriginatorIdentifierOrKey.java


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