本文整理匯總了Java中org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive方法的典型用法代碼示例。如果您正苦於以下問題:Java ASN1Encodable.toASN1Primitive方法的具體用法?Java ASN1Encodable.toASN1Primitive怎麽用?Java ASN1Encodable.toASN1Primitive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bouncycastle.asn1.ASN1Encodable
的用法示例。
在下文中一共展示了ASN1Encodable.toASN1Primitive方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ExtendedKeyUsage
import org.bouncycastle.asn1.ASN1Encodable; //導入方法依賴的package包/類
private ExtendedKeyUsage(
ASN1Sequence seq)
{
this.seq = seq;
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1Encodable o = (ASN1Encodable)e.nextElement();
if (!(o.toASN1Primitive() instanceof ASN1ObjectIdentifier))
{
throw new IllegalArgumentException("Only ASN1ObjectIdentifiers allowed in ExtendedKeyUsage.");
}
this.usageTable.put(o, o);
}
}
示例2: getEncodedPrivateKeyInfo
import org.bouncycastle.asn1.ASN1Encodable; //導入方法依賴的package包/類
public static byte[] getEncodedPrivateKeyInfo(AlgorithmIdentifier algId, ASN1Encodable privKey)
{
try
{
PrivateKeyInfo info = new PrivateKeyInfo(algId, privKey.toASN1Primitive());
return getEncodedPrivateKeyInfo(info);
}
catch (Exception e)
{
return null;
}
}
示例3: ContentHints
import org.bouncycastle.asn1.ASN1Encodable; //導入方法依賴的package包/類
/**
* constructor
*/
private ContentHints(ASN1Sequence seq)
{
ASN1Encodable field = seq.getObjectAt(0);
if (field.toASN1Primitive() instanceof DERUTF8String)
{
contentDescription = DERUTF8String.getInstance(field);
contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(1));
}
else
{
contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
}
}