Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert X509Certificate into .p7b file

843811Jan 30 2007 — edited Oct 26 2008
I have a X509Certificate and I'd like to save it into a PKCS#7 .p7b file. Currently, I'm able to save it into a .cer file with the following code:
 private void writeCertificate(Writer writer,
                                X509Certificate cert)
    throws Exception
    {
    writer.write(BEGIN_CERTIFICATE_MARKER);
    writer.write("\n");
    writer.write(new String(Base64.encode(cert.getEncoded())));
    writer.write("\n");
    writer.write(END_CERTIFICATE_MARKER);
    writer.close();
    }
What do I need to do to save as a .p7b file instead?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2008
Added on Jan 30 2007
3 comments
463 views