Search code examples
javacertificatekeystoretruststorejks

Modifying Organization for an alias in keystore file


My team has a java application held on a unix server that makes use of certificates to communicate to other platforms (not for the web app).

Such certificates are somewhat managed by a team (i guess with keeping to standards or somerhing).

Not too long this team had migrated to a new 'standard' (i'll call it) in non-prod, and various teams had to update their certificates (including mine) but it is a little problematic since none of us really understand (we have a high level view only)

From my understanding, we have a Keystore, we need to make a CSR file. I believe there is some automated tool my company has where providing the CSR will generate a CER that i just need to import (whether in my truststore or keystore)

Having said that it seems like before making the CSR i need to update the organisation for an alias

E.g. from O=ABC To O=A Boring Company

I was hoping i could use the java keytool to manually update the single variable like:

keytool -alias myalias -change O=A Boring Company -keystore mykeystore.jks

From my google searches, there doesn't seem to be an option where i can just modify the organization only and keep all the same

Can anyone give some advice?

I may need to modify other parameters too although if i try to delete the alias and recreate with all new parameters i'm worried there may be some variable that is missed out

Basic parameters like country, organisation, common name i know, but there could be other things like Cipher etc that i'm not aware of


Solution

  • nop, that doesn't work as you would like. if you change the organisation, the certificate hash is not valid anymore, even if the public key (for which it was signed) remains the same.