Skip to content

Instantly share code, notes, and snippets.

@stephen-marc
stephen-marc / Changed Cancelation Dialog.png
Last active August 17, 2018 15:06
Mood Diary Entry Behaviour
Changed Cancelation Dialog.png

Keybase proof

I hereby claim:

To claim this, I am signing this object:

public static void main(
String args[])
throws Exception
{
if (args.length != 2)
{
System.err.println("usage: CreateEncryptedMail pkcs12Keystore password");
System.exit(0);
}
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.Message;
/*KeyStore ks = KeyStore.getInstance("PKCS12");
FileInputStream fis = new FileInputStream(args[0]);
ks.load(fis, args[1].toCharArray());
fis.close();
*/
in place of
KeyStore ks = KeyStore.getInstance("PKCS12", "BC");
ks.load(new FileInputStream(args[0]), args[1].toCharArray());
then the first error is replaced by the follwing error
exception in thread main org.bouncycastle.mail.smime.smimeexception