Suleman Butt
2014-08-12 15:16:10 UTC
Hi All,
On my reading the smime.p7m, I get the nullpointer exception at :
SMIMEEnveloped env = new SMIMEEnveloped(message);
The method --message.getContentType() produces "text/plain" as output, but
then at the SMIMEEnveloped(message) null pointer exception is raised.
I am using: bcprov-jdk16-1.45 and bcmail-jdk16-1.46.
Security.addProvider(new BouncyCastleProvider());
Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props,
null);
MimeMessage message = new MimeMessage(session, new
FileInputStream("C:/temp/smime.p7m"));
Part strippedMessage = null;
System.out.println("Starting message decryption.." +
message.getContentType());
if (message.isMimeType("application/x-pkcs7-mime") ||
message.isMimeType("application/pkcs7-mime") ||
message.isMimeType("text/plain")){
try {
SMIMEEnveloped env = new
SMIMEEnveloped(message);
....
On my reading the smime.p7m, I get the nullpointer exception at :
SMIMEEnveloped env = new SMIMEEnveloped(message);
The method --message.getContentType() produces "text/plain" as output, but
then at the SMIMEEnveloped(message) null pointer exception is raised.
I am using: bcprov-jdk16-1.45 and bcmail-jdk16-1.46.
Security.addProvider(new BouncyCastleProvider());
Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props,
null);
MimeMessage message = new MimeMessage(session, new
FileInputStream("C:/temp/smime.p7m"));
Part strippedMessage = null;
System.out.println("Starting message decryption.." +
message.getContentType());
if (message.isMimeType("application/x-pkcs7-mime") ||
message.isMimeType("application/pkcs7-mime") ||
message.isMimeType("text/plain")){
try {
SMIMEEnveloped env = new
SMIMEEnveloped(message);
....
--
Regards Suleman
Regards Suleman