本文整理匯總了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);
}
示例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);
}
示例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());
}
}
示例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();
}
示例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");
}
}
示例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");
}
}
示例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;
}
示例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;
}
示例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();
}
示例10: getKey
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public BigInteger getKey()
{
ASN1OctetString octs = (ASN1OctetString)seq.getObjectAt(1);
return new BigInteger(1, octs.getOctets());
}
示例11: getKey
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public BigInteger getKey()
{
ASN1OctetString octs = (ASN1OctetString)seq.getObjectAt(1);
return new BigInteger(1, octs.getOctets());
}
示例12: SubjectKeyIdentifier
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
protected SubjectKeyIdentifier(
ASN1OctetString keyid)
{
this.keyidentifier = keyid.getOctets();
}
示例13: X9FieldElement
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public X9FieldElement(BigInteger p, ASN1OctetString s)
{
this(new ECFieldElement.Fp(p, new BigInteger(1, s.getOctets())));
}
示例14: OriginatorIdentifierOrKey
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
/**
* @deprecated use version taking a SubjectKeyIdentifier
*/
public OriginatorIdentifierOrKey(
ASN1OctetString id)
{
this(new SubjectKeyIdentifier(id.getOctets()));
}