I am using a JRE 8u211. And i have few certificates added in cacerts. But when I upgrade JRE to 8u261, those certificates are not getting imported. So now i want to programmatically export the required certificates from cacerts file of 8u211 using the alias names and then import those certificates to the cacerts file of 8u261.
Is this even possible or supported?
Thanks in advance.
Certificate is just a data. You definitely can export it to the file, and import that data into some other file.
If you just want to import one truststore file's data into another, you can directly make use of buffer without storing data into an intermediary file:
However, you can also do these two operations one by one:
To export the certificate:
To import the certificate:
More on this can be read here, here and here.