培训考核三期,新版培训,网页版培训登录器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.6 KiB

#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
public class OriginatorInfoGenerator
{
private readonly IList origCerts;
private readonly IList origCrls;
public OriginatorInfoGenerator(X509Certificate origCert)
{
this.origCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1);
this.origCrls = null;
origCerts.Add(origCert.CertificateStructure);
}
public OriginatorInfoGenerator(IX509Store origCerts)
: this(origCerts, null)
{
}
public OriginatorInfoGenerator(IX509Store origCerts, IX509Store origCrls)
{
this.origCerts = CmsUtilities.GetCertificatesFromStore(origCerts);
this.origCrls = origCrls == null ? null : CmsUtilities.GetCrlsFromStore(origCrls);
}
public virtual OriginatorInfo Generate()
{
Asn1Set certSet = CmsUtilities.CreateDerSetFromList(origCerts);
Asn1Set crlSet = origCrls == null ? null : CmsUtilities.CreateDerSetFromList(origCrls);
return new OriginatorInfo(certSet, crlSet);
}
}
}
#pragma warning restore
#endif