本文整理汇总了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));
}
}