signedandenvelopeddata.java
来自「进行与数字证书相关开发必须的java源码」· Java 代码 · 共 134 行
JAVA
134 行
// 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: SignedAndEnvelopedData.java
package jit.asn1.pkcs.pkcs7;
import java.util.Enumeration;
import jit.asn1.*;
// Referenced classes of package jit.asn1.pkcs.pkcs7:
// EncryptedContentInfo
public class SignedAndEnvelopedData
implements DEREncodable
{
private DERInteger version;
private ASN1Set recipientInfos;
private ASN1Set digestAlgorithms;
private EncryptedContentInfo encryptedContentInfo;
private ASN1Set certificates;
private ASN1Set crls;
private ASN1Set signerInfos;
public static SignedAndEnvelopedData getInstance(Object o)
{
if(o == null || (o instanceof SignedAndEnvelopedData))
return (SignedAndEnvelopedData)o;
if(o instanceof ASN1Sequence)
return new SignedAndEnvelopedData((ASN1Sequence)o);
else
throw new IllegalArgumentException("unknown object in factory:".concat(String.valueOf(String.valueOf(o.getClass().getName()))));
}
public SignedAndEnvelopedData(DERInteger _version, ASN1Set _recipientInfos, ASN1Set _digestAlgorithms, EncryptedContentInfo _encryptedContentInfo, ASN1Set _certificates, ASN1Set _crls, ASN1Set _signerInfos)
{
version = _version;
recipientInfos = _recipientInfos;
digestAlgorithms = _digestAlgorithms;
encryptedContentInfo = _encryptedContentInfo;
certificates = _certificates;
crls = _crls;
signerInfos = _signerInfos;
}
public SignedAndEnvelopedData(ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
version = (DERInteger)e.nextElement();
recipientInfos = (ASN1Set)e.nextElement();
digestAlgorithms = (ASN1Set)e.nextElement();
encryptedContentInfo = EncryptedContentInfo.getInstance(e.nextElement());
do
{
while(e.hasMoreElements())
{
DERObject o = (DERObject)e.nextElement();
if(o instanceof DERTaggedObject)
{
DERTaggedObject tagged = (DERTaggedObject)o;
switch(tagged.getTagNo())
{
case 0: // '\0'
certificates = ASN1Set.getInstance(tagged, false);
break;
case 1: // '\001'
crls = ASN1Set.getInstance(tagged, false);
break;
default:
throw new IllegalArgumentException("unknown tag value ".concat(String.valueOf(String.valueOf(tagged.getTagNo()))));
}
} else
{
signerInfos = (ASN1Set)o;
}
}
return;
} while(true);
}
public DERInteger getVersin()
{
return version;
}
public ASN1Set getRecipientInfos()
{
return recipientInfos;
}
public ASN1Set getDigestAlgorithms()
{
return digestAlgorithms;
}
public EncryptedContentInfo getEncryptedContentInfo()
{
return encryptedContentInfo;
}
public ASN1Set getCertificates()
{
return certificates;
}
public ASN1Set getCrls()
{
return crls;
}
public ASN1Set getSignerInfos()
{
return signerInfos;
}
public DERObject getDERObject()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(recipientInfos);
v.add(digestAlgorithms);
v.add(encryptedContentInfo);
if(certificates != null)
v.add(new DERTaggedObject(false, 0, certificates));
if(crls != null)
v.add(new DERTaggedObject(false, 1, crls));
v.add(signerInfos);
return new DERSequence(v);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?