contentinfo.java
来自「进行与数字证书相关开发必须的java源码」· Java 代码 · 共 74 行
JAVA
74 行
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: ContentInfo.java
package jit.asn1.pkcs.pkcs7;
import java.util.Enumeration;
import jit.asn1.*;
import jit.asn1.pkcs.PKCSObjectIdentifiers;
public class ContentInfo
implements DEREncodable, PKCSObjectIdentifiers
{
private DERObjectIdentifier contentType;
private DEREncodable content;
public static ContentInfo getInstance(Object obj)
{
if(obj instanceof ContentInfo)
return (ContentInfo)obj;
if(obj instanceof ASN1Sequence)
return new ContentInfo((ASN1Sequence)obj);
else
throw new IllegalArgumentException("unknown object in factory");
}
public ContentInfo(ASN1Sequence seq)
{
contentType = null;
content = null;
Enumeration e = seq.getObjects();
contentType = (DERObjectIdentifier)e.nextElement();
if(e.hasMoreElements())
content = ((DERTaggedObject)e.nextElement()).getObject();
}
public ContentInfo(DERObjectIdentifier contentType)
{
this.contentType = null;
content = null;
this.contentType = contentType;
content = null;
}
public ContentInfo(DERObjectIdentifier contentType, DEREncodable content)
{
this.contentType = null;
this.content = null;
this.contentType = contentType;
this.content = content;
}
public DERObjectIdentifier getContentType()
{
return contentType;
}
public DEREncodable getContent()
{
return content;
}
public DERObject getDERObject()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
if(content != null)
v.add(new BERTaggedObject(0, content));
return new BERSequence(v);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?