Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GenRsa Generate.go
func main() {
reader := rand.Reader
bitSize := 2048
key, err := rsa.GenerateKey(reader, bitSize)
checkError(err)
publicKey := key.PublicKey
saveGobKey("private.key", key)
savePEMKey("private.pem", key)
saveGobKey("public.key", publicKey)
savePublicPEMKey("public.pem", publicKey)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment