PkcsSignerInfoBuilderSign Method

Signs authenticated attributes.

Definition

Namespace: SysadminsLV.PKI.Cryptography.Pkcs
Assembly: SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 4.0.1
C#
public PkcsSignerInfo Sign(
	ICryptSigner messageSigner,
	byte[] content
)

Parameters

messageSigner  ICryptSigner
Signer certificate to use in signing operations.
content  Byte
An optional content to sign. This parameter can be null if AuthenticatedAttributes contain Message Digest attribute. If this attribute is not presented, content parameter cannot be null.

Return Value

PkcsSignerInfo
Signed signer info that can be added to signed CMS message.

Exceptions

ArgumentNullExceptionmessageSigner parameter is null.
ArgumentExceptionMessage Digest attribute is missing and no content provided to sign.
CryptographicException Signer certificate is configured to use PSS padding for signature which is not supported.

See Also