I read this article on how to use keytool to generate CSRs for your organization. It was simple and easy, but left me with a few questions that I couldn’t find clear, descriptive answers to:
- What is Java’s concept of a CSR
aliasand why would you want to use one? Where is this alias field stored and what other tools/APIs have access to it? - What is the difference between a
keyand akeystore?
What is Java’s concept of a CSR alias and why would you want to use one? Where is this alias field stored and what other tools/APIs have access to it?
First of all, java uses keystores to keep keys (and certificates) inside. Single keystore can hold many certificates, so you need a way to differentiate them. That’s what aliases are for. Having a keystore, an alias (and a password if needed) you can get the certificate from the keystore using Java Crypto API (specifically classes like
Keystore). Here, you have a an example of how the Crypto API can be used to load a key from keystoreWhat is the difference between a key and a keystore?
The keystore is a container. The keys are kept inside keystores.