About
A public key is a key used in the public cryptographic system.
The public key is often saved in a cer format.
Distribution
The public key distribution can be done:
- through public key servers. When a person creates a key-pair, they keep one key private and the other, known as the public-key, is uploaded to a server where it can be accessed by anyone to send the user a private, encrypted, message.
- by publishing it in a public directory such as with a certification authority.
- through an algorithm: See for instance: Diffie–Hellman key exchange and rsa
I judged it most important for military use … if you can share your key rapidly and electronically, you have a major advantage over your opponent.
Creation
A public key is created from a private key.
Example: create a rsa public key from a rsa private key
openssl rsa -in key.pem -pubout -out pubkey.pem
See also: Keypair (public and a private key) to create a public key and a private key at once.
Storage
Client
- SSH-2 standard format: The Secure Shell (SSH) Public Key File Format - RFC 4716 specifies a standard format for storing SSH-2 public keys on disk. Used by Putty.
- OpenSSH, use a different format. Example for rsa and dss
ssh-rsa key key-comment