init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
using Org.BouncyCastle.Asn1.Cms;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.X509;
namespace Org.BouncyCastle.Cms;
public class SignerInfoGenerator
{
internal X509Certificate certificate;
internal ISignatureFactory contentSigner;
internal SignerIdentifier sigId;
internal CmsAttributeTableGenerator signedGen;
internal CmsAttributeTableGenerator unsignedGen;
private bool isDirectSignature;
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory)
: this(sigId, signerFactory, isDirectSignature: false)
{
}
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory, bool isDirectSignature)
{
this.sigId = sigId;
contentSigner = signerFactory;
this.isDirectSignature = isDirectSignature;
if (this.isDirectSignature)
{
signedGen = null;
unsignedGen = null;
}
else
{
signedGen = new DefaultSignedAttributeTableGenerator();
unsignedGen = null;
}
}
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen)
{
this.sigId = sigId;
this.contentSigner = contentSigner;
this.signedGen = signedGen;
this.unsignedGen = unsignedGen;
isDirectSignature = false;
}
internal void setAssociatedCertificate(X509Certificate certificate)
{
this.certificate = certificate;
}
}