-
Notifications
You must be signed in to change notification settings - Fork 17
Opinionated behavior limits usabilityΒ #2
Description
After searching online, this library as the simplest and best implementation of S/MIME support in Java I could find. Thank you for your work!
I've integrated it into our application, but have run into an issue related to the hard coded default DES_EDE3_CBC algorithm in SmimeUtil.prepareEncryptor(). Our use case requires us to use AES_256_CBC instead. I was able to work around this by creating SmimeUtil.encrypt(Session session, MimeMessage mimeMessage, X509Certificate certificate, ASN1ObjectIdentifier cmsAlgorithm)
Additionally, it may be worth adding some comments in the readme about how SmimeUtil.sign(...) will canonicalize EOL characters as a side-effect. This has the potential of corrupting attachments, as was the case for us. The work-around is to force a Base64 (or something else that will never have a newline) encoding of the attachment instead of allowing the default (7bit text in our case)
If you'd be interested in a pull request, I can try submitting one. It would be a first for me.
Thanks again for this library!