Click or drag to resize
MimeKit

CmsEnvelopeException Class

The exception that is thrown if an error occurs while generating a CMS envelope.
Inheritance Hierarchy
SystemObject
  SystemException
    CmsException
      MimeKit.CryptographyCmsEnvelopeException

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.17.0
Syntax
C#
public class CmsEnvelopeException : CmsException

The CmsEnvelopeException type exposes the following members.

Constructors
 NameDescription
Public methodCmsEnvelopeException Initialize a new instance of the CmsEnvelopeException class.
Top
Properties
 NameDescription
Public propertyData
(Inherited from Exception)
Public propertyHelpLink
(Inherited from Exception)
Public propertyHResult
(Inherited from Exception)
Public propertyInnerException
(Inherited from Exception)
Public propertyMessage
(Inherited from Exception)
Public propertySource
(Inherited from Exception)
Public propertyStackTrace
(Inherited from Exception)
Public propertyTargetSite
(Inherited from Exception)
Top
Methods
 NameDescription
Public methodEquals
(Inherited from Object)
Protected methodFinalize
(Inherited from Object)
Public methodGetBaseException
(Inherited from Exception)
Public methodGetHashCode
(Inherited from Object)
Public methodGetObjectData
(Inherited from Exception)
Public methodGetType
(Inherited from Exception)
Protected methodMemberwiseClone
(Inherited from Object)
Public methodToString
(Inherited from Exception)
Top
Events
 NameDescription
Protected eventSerializeObjectState
(Inherited from Exception)
Top
Remarks

This exception is thrown by the BouncyCastleSecureMimeContext.Encrypt and BouncyCastleSecureMimeContext.EncryptAsync methods when an error occurs while generating a CMS envelope.

The InnerException will typically be one of the following types:

  1. AggregateException: One or more of the recipient certificates failed validation.

    In this scenario, callers may iterate over each of the InnerExceptions for exceptions of type CmsRecipientException. These exceptions can be used to remove the failed recipients before retrying the encryption operation.

  2. CmsException: An error within BouncyCastle occurred.

See Also