SignedCmsBuilderSign Method |
Signs current PKCS#7 message and adds a new signer information to
SignerInfos collection.
Certificates specified in
chain parameter are added to
Certificates collection.
Namespace:
SysadminsLV.PKI.Cryptography.Pkcs
Assembly:
SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 3.7.0.0 (3.7.0.0)
Syntax public DefaultSignedPkcs7 Sign(
MessageSigner signer,
X509Certificate2Collection chain = null
)
Public Function Sign (
signer As MessageSigner,
Optional chain As X509Certificate2Collection = Nothing
) As DefaultSignedPkcs7
public:
DefaultSignedPkcs7^ Sign(
MessageSigner^ signer,
X509Certificate2Collection^ chain = nullptr
)
member Sign :
signer : MessageSigner *
?chain : X509Certificate2Collection
(* Defaults:
let _chain = defaultArg chain null
*)
-> DefaultSignedPkcs7
Parameters
- signer
- Type: SysadminsLV.PKI.Tools.MessageOperationsMessageSigner
signing object that contains public certificate, private key and signing configuration. - chain (Optional)
- Type: System.Security.Cryptography.X509CertificatesX509Certificate2Collection
Signing certificate chain to add to CMS. This parameter is optional. If not specified, only leaf (signing) certificate
is added to Certificates collection and signed message.
Return Value
Type:
DefaultSignedPkcs7
An instance of
DefaultSignedPkcs7 class that represents signed CMS message.
Exceptions Exception | Condition |
---|
InvalidOperationException |
No data to sign was passed in the constructor.
|
Remarks
You can call this method multiple times to attach multiple signatures to signed CMS message.
See Also