Encode Java keystore certificate chain entry

edc
edc used Ask the Experts™
on
Hello all,
In  my code I am exporting a certificate from a java keystore via the Certificate's getEncoded function and then Base64 encoding the resulting encoded cert.  I will now be dealing with certificate chains as well.

My question is how do I export the certificate chain?  Do I call the getEncoded method on each of the certificates in the Certificate array and then concatinate them together?  Is there a more elegant method?

Thanks very much.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
There is no more elegant method than that.  AFIK there is not structure with dealing with certificate chains.

You don't say what version of Java you are working with either so it is difficult to be more explicit.
edc

Author

Commented:
Thanks sweetfa2.  All the examples I have managed to troll say the same thing.  I'm using JDK 1.7, but it does not look like there is anything new in that arena either.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial