asn1dumpexample.java
来自「sip CMSEnvelopedData」· Java 代码 · 共 33 行
JAVA
33 行
package chapter5;
import java.util.Date;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.util.ASN1Dump;
/**
* Example for ASN1Dump using MyStructure.
*/
public class ASN1DumpExample
{
public static void main(String[] args)
throws Exception
{
byte[] baseData = new byte[5];
Date created = new Date(0); // 1/1/1970
MyStructure structure = new MyStructure(0, created, baseData, "hello", "world");
System.out.println(ASN1Dump.dumpAsString(structure));
structure = new MyStructure(1, created, baseData, "hello", "world");
System.out.println(ASN1Dump.dumpAsString(structure));
ASN1InputStream aIn = new ASN1InputStream(structure.getEncoded());
System.out.println(ASN1Dump.dumpAsString(aIn.readObject()));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?