WindowsSecureMimeContextUpdateSecureMimeCapabilities Method

Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate.

Definition

Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
protected virtual void UpdateSecureMimeCapabilities(
	X509Certificate2 certificate,
	EncryptionAlgorithm[] algorithms,
	DateTime timestamp
)

Parameters

certificate  X509Certificate2
The certificate.
algorithms  EncryptionAlgorithm
The encryption algorithm capabilities of the client (in preferred order).
timestamp  DateTime
The timestamp.

Remarks

Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate.

This method is called when decoding digital signatures that include S/MIME capabilities in the metadata, allowing custom implementations to update the X.509 certificate records with the list of preferred encryption algorithms specified by the sending client.

The default implementation caches the S/MIME capabilities in memory for the lifetime of the WindowsSecureMimeContext so that they can be used by GetPreferredEncryptionAlgorithm(CmsRecipientCollection). The S/MIME capabilities are not persisted because the Windows X.509 certificate stores do not provide a standard way of associating them with a certificate. Custom implementations that wish to persist them should override this method along with GetPreferredEncryptionAlgorithm(CmsRecipientCollection).

The signer's certificate is imported into the AddressBook store separately, before this method is called.

See Also