CryptoSys PKI Pro Manual

Cms.MakeSigData(String, String, String, String, Cms.SigAlg, Cms.SigDataOptions) Method

Create a CMS object of type SignedData from an input data file (advanced options including RSA-PSS).

Syntax

[C#]
public static int MakeSigData(
   string outputFile,
   string inputFile,
   string certList,
   string privateKey,
   Cms.SigAlg sigAlg,
   Cms.SigDataOptions advOptions = Cms.SigDataOptions.Default 
)
[VB]
Public Shared Function MakeSigData (
   outputFile As String,
   inputFile As String,
   certList As String,
   privateKey As String,
   sigAlg As Cms.SigAlg,
   Optional advOptions As Cms.SigDataOptions = Cms.SigDataOptions.Default 
) As Integer

Parameters

outputFile  String
name of output file to be created
inputFile  String
name of file containing message data to be signed
certList  String
filename of the signer's certificate and (optionally) a list of other certificates to be included in the output, separated by semi-colons (;) Alternatively specify a single PKCS#7 certificate chain file (.p7c/.p7b) containing the signer's certificate.
privateKey  String
private key data for the sender
sigAlg  Cms.SigAlg
Signature algorithm.
advOptions  Cms.SigDataOptions  (Optional)
Advanced option flags.

Return Value

Int32
Zero if successful; otherwise it returns an error code

Example

StringBuilder sbPrivateKey = Rsa.ReadPrivateKey("AlicePrivRSASign.p8e", "password");
string fnameOutput = "BasicSignByAlice.bin";
string fnameInput = "excontent.txt";
string fnameCert = "AliceRSASignByCarl.cer";
int n = Cms.MakeSigData(fnameOutput, fnameInput, fnameCert, sbPrivateKey.ToString(), Cms.SigAlg.Default, 0);

See Also

VB6/C equivalent: CMS_MakeSigData

[Contents] [Index]

[PREV: Cms.MakeEnvDataFromString(String, String, String, CipherAlgorithm, Cms.KeyEncrAlgorithm, HashAlgorithm, Cms.EnvDataOptions, Kdf.KdfAlg, Kdf.KeyWrapAlg, String, Int32, Cms.ContentEncrAlg) Method...]   [Contents]   [Index]   
   [NEXT: Cms.MakeSigData(String, String, String, String, HashAlgorithm, Cms.SigDataOptions) Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.