A community member has associated this post with a similar question:
How to Support S/MIME using java mail.
Only moderators can edit this content.
How to support S/MIME using java.
Anonymous
Hi all,
I want to send S/MIME encrypted mail but, while sending I am getting an error :
I tried sending an encrypted attachment through Java code but got an error when accessing it after downloading.
below is the code I am using :
KeyStore keystore = KeyStore.getInstance("PKCS12");
FileInputStream fis = new FileInputStream("Path/keystore.p12");
keystore.load(fis, "p12password".toCharArray());
PrivateKey privateKey = (PrivateKey) keystore.getKey("myalias", "p12password".toCharArray());
Certificate cert = keystore.getCertificate("myalias");
Certificate recipientCert = keystore.getCertificate("myalias");
Questions:
- How can I install the S/MIME extension?
- The Java code I provided is right or wrong?
- If not then what is the right to send and read S/MIME encrypted messages using Java code?
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
Microsoft Security | Microsoft Graph
Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
{count} votes