bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)
http://www.simplejavamail.org
Apache License 2.0
1.2k stars 261 forks source link

Make S/MIME algorithms configurable (signature algorithm for signing, key encapsulation and cipher algorithms for encryption) #498

Closed asariev closed 3 months ago

bbottema commented 3 months ago

I think it was about time this was configurable. I'm almost done with it.

bbottema commented 3 months ago

Feature released in 8.7.1.

Please refer to the documentation on signing and encrypting with S/MIME. You can now set any signature algorithm when signing and any key encapsulation algorithm and cipher algorithm when encrypting. Enjoy!

bbottema commented 3 months ago

To give a specific example of your request:

Email emailToBeEncrypted = currentEmailBuilder
    .(..)
    .encryptWithSmime(SmimeEncryptConfig.builder()
        .x509Certificate(yourCertificate)
        .cipherAlgorithm("AES256_CBC")
        .build())
    .buildEmail();
asariev commented 3 months ago

Love it! Let me test it. I have several projects that require different types of cipher algorithms. It makes my life easier.

Thank you!

On Thu, Mar 21, 2024 at 2:08 PM Benny Bottema @.***> wrote:

To give a specific example of your request:

Email emailToBeEncrypted = currentEmailBuilder .(..) .encryptWithSmime(SmimeEncryptConfig.builder() .x509Certificate(yourCertificate) .cipherAlgorithm("AES256_CBC") .build()) .buildEmail();

— Reply to this email directly, view it on GitHub https://github.com/bbottema/simple-java-mail/issues/498#issuecomment-2013371689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMGUTWQH4B2WNLXHI6XF33YZMV2RAVCNFSM6AAAAABE5CNMOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJTGM3TCNRYHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Best regards,

Aibek Sariev