📄 contentinfo.java
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -