Generating a public and private key pair

Before using asymmetric encryption, you need a public and private key pair. The private key must be kept secure and not shared with anyone. The public key should be shared with others.

RSA (Rivest-Shamir-Adleman) and ECDSA (Elliptic Curve Digital Signing Algorithm) algorithms are available in the Go standard library. ECDSA is considered more secure, but RSA is the most common algorithm used in SSL certificates.

You have the option to password protect your private key. You don't need to do it, but it is an extra layer of security. Because the private key is so sensitive, it is recommended that you use password protection.

If you want to password protect your private key file using a symmetric encryption ...

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.