本文整理匯總了Java中org.bouncycastle.asn1.DEROctetString.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java DEROctetString.getInstance方法的具體用法?Java DEROctetString.getInstance怎麽用?Java DEROctetString.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bouncycastle.asn1.DEROctetString
的用法示例。
在下文中一共展示了DEROctetString.getInstance方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: digestSecretKey0
import org.bouncycastle.asn1.DEROctetString; //導入方法依賴的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();
}
示例2: SignerInfo
import org.bouncycastle.asn1.DEROctetString; //導入方法依賴的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;
}
}
示例3: SignerInfo
import org.bouncycastle.asn1.DEROctetString; //導入方法依賴的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;
}
}
示例4: sign0
import org.bouncycastle.asn1.DEROctetString; //導入方法依賴的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();
}
示例5: Asn1P11Params
import org.bouncycastle.asn1.DEROctetString; //導入方法依賴的package包/類
private Asn1P11Params(ASN1TaggedObject taggedObject) throws BadAsn1ObjectException {
this.tagNo = taggedObject.getTagNo();
if (tagNo == 0) {
this.p11Params = Asn1RSAPkcsPssParams.getInstance(taggedObject.getObject());
} else if (tagNo == 1) {
this.p11Params = DEROctetString.getInstance(taggedObject.getObject());
} else {
throw new BadAsn1ObjectException("invalid tag " + tagNo);
}
}
示例6: removingTagAndLenFromExtensionValue
import org.bouncycastle.asn1.DEROctetString; //導入方法依賴的package包/類
private static byte[] removingTagAndLenFromExtensionValue(byte[] encodedExtensionValue) {
DEROctetString derOctet = (DEROctetString) DEROctetString.getInstance(
encodedExtensionValue);
return derOctet.getOctets();
}