本文整理汇总了Java中org.bouncycastle.asn1.misc.VerisignCzagExtension类的典型用法代码示例。如果您正苦于以下问题:Java VerisignCzagExtension类的具体用法?Java VerisignCzagExtension怎么用?Java VerisignCzagExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VerisignCzagExtension类属于org.bouncycastle.asn1.misc包,在下文中一共展示了VerisignCzagExtension类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: performTest
import org.bouncycastle.asn1.misc.VerisignCzagExtension; //导入依赖的package包/类
public void performTest()
throws Exception
{
byte[] testIv = { 1, 2, 3, 4, 5, 6, 7, 8 };
ASN1Encodable[] values = {
new CAST5CBCParameters(testIv, 128),
new NetscapeCertType(NetscapeCertType.smime),
new VerisignCzagExtension(new DERIA5String("hello")),
new IDEACBCPar(testIv),
new NetscapeRevocationURL(new DERIA5String("http://test"))
};
byte[] data = Base64.decode("MA4ECAECAwQFBgcIAgIAgAMCBSAWBWhlbGxvMAoECAECAwQFBgcIFgtodHRwOi8vdGVzdA==");
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
for (int i = 0; i != values.length; i++)
{
aOut.writeObject(values[i]);
}
ASN1Primitive[] readValues = new ASN1Primitive[values.length];
if (!isSameAs(bOut.toByteArray(), data))
{
fail("Failed data check");
}
ByteArrayInputStream bIn = new ByteArrayInputStream(bOut.toByteArray());
ASN1InputStream aIn = new ASN1InputStream(bIn);
for (int i = 0; i != values.length; i++)
{
ASN1Primitive o = aIn.readObject();
if (!values[i].equals(o))
{
fail("Failed equality test for " + o);
}
if (o.hashCode() != values[i].hashCode())
{
fail("Failed hashCode test for " + o);
}
}
shouldFailOnExtraData();
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:50,代码来源:MiscTest.java
示例2: perform
import org.bouncycastle.asn1.misc.VerisignCzagExtension; //导入依赖的package包/类
public TestResult perform()
{
byte[] testIv = { 1, 2, 3, 4, 5, 6, 7, 8 };
ASN1Encodable[] values = {
new CAST5CBCParameters(testIv, 128),
new NetscapeCertType(NetscapeCertType.smime),
new VerisignCzagExtension(new DERIA5String("hello")),
new IDEACBCPar(testIv),
new NetscapeRevocationURL(new DERIA5String("http://test"))
};
byte[] data = Base64.decode("MA4ECAECAwQFBgcIAgIAgAMCBSAWBWhlbGxvMAoECAECAwQFBgcIFgtodHRwOi8vdGVzdA==");
try
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
for (int i = 0; i != values.length; i++)
{
aOut.writeObject(values[i]);
}
ASN1Primitive[] readValues = new ASN1Primitive[values.length];
if (!isSameAs(bOut.toByteArray(), data))
{
return new SimpleTestResult(false, getName() + ": Failed data check");
}
ByteArrayInputStream bIn = new ByteArrayInputStream(bOut.toByteArray());
ASN1InputStream aIn = new ASN1InputStream(bIn);
for (int i = 0; i != values.length; i++)
{
ASN1Primitive o = aIn.readObject();
if (!values[i].equals(o))
{
return new SimpleTestResult(false, getName() + ": Failed equality test for " + o);
}
if (o.hashCode() != values[i].hashCode())
{
return new SimpleTestResult(false, getName() + ": Failed hashCode test for " + o);
}
}
return new SimpleTestResult(true, getName() + ": Okay");
}
catch (Exception e)
{
return new SimpleTestResult(false, getName() + ": Failed - exception " + e.toString(), e);
}
}
开发者ID:credentials,项目名称:irma_future_id,代码行数:56,代码来源:MiscTest.java
注:本文中的org.bouncycastle.asn1.misc.VerisignCzagExtension类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论