Smime Class |
Namespace: MailBee.Security
The Smime type exposes the following members.
Name | Description | |
---|---|---|
![]() | Smime |
Creates an instance of Smime class.
|
![]() | Smime(String) |
Creates and unlocks an instance of Smime class.
|
Name | Description | |
---|---|---|
![]() ![]() | Decrypt(MailMessage) |
Decrypts an e-mail message if it's encrypted.
|
![]() ![]() | Decrypt(MailMessage, CertificateStore) |
Decrypts an e-mail message if it's encrypted.
|
![]() ![]() | DecryptAndVerify(MailMessage, MessageVerificationFlags) |
Decrypts an e-mail message if it's encrypted and verifies its signature if it's signed.
|
![]() ![]() | DecryptAndVerify(MailMessage, MessageVerificationFlags, CertificateStore, CertificateStore) |
Decrypts an e-mail message if it's encrypted and verifies its signature if it's signed.
|
![]() ![]() | Encrypt |
Encrypts an e-mail message.
|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | ResetToDefaults |
Resets S/MIME settings to default values.
|
![]() ![]() | Sign |
Signs an e-mail message with a digital signature.
|
![]() ![]() | SignAndEncrypt |
Signs and encrypts an e-mail message.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() | Verify |
Verifies if the signature of the specified e-mail message is valid.
|
Name | Description | |
---|---|---|
![]() ![]() | EncryptionAlgorithm |
Gets or sets the algorithm to use for encrypting messages.
|
![]() ![]() | HashAlgorithm |
Gets or sets the hash algorithm to use for signing messages with a digital signature.
|
![]() | LastResult |
Gets a numeric code of the last error.
|
![]() ![]() | Provider |
Gets or sets the CSP to be used for cryptographic operations.
|
![]() | ThrowExceptions |
Gets or sets whether the object will throw exceptions on errors.
|
The class by default uses FIPS compliant algorithms: RSA DES for encryption and SHA1 for signing.
![]() |
---|
To use this class, make sure MailBee.NET Security Powerup is licensed (see LicenseKey property for details). |
// To use the code below, import these namespaces at the top of your code using System; using MailBee; using MailBee.Pop3Mail; using MailBee.Mime; using MailBee.Security; Smime objSmime = new Smime(); Pop3 pop = new Pop3(); pop.Connect("server", 110, true); pop.Login("login", "password"); MailMessage msg = pop.DownloadEntireMessage(pop.InboxMessageCount); pop.Disconnect(); try { if (msg.IsEncrypted) { SmimeResult smResult = objSmime.DecryptAndVerify(msg, MessageVerificationFlags.All); if (smResult.VerificationResult > 0) { Console.WriteLine("Verification failed"); } else if (smResult.DecryptedMessage != null) { Console.WriteLine(smResult.DecryptedMessage.BodyPlainText); } } } catch (MailBeeException ex) { Console.WriteLine(ex.Message); }