Created
November 27, 2020 16:55
-
-
Save MCMXCIII/b837c0d838fffd246dea235b7cb385fb to your computer and use it in GitHub Desktop.
GenRsa Generate.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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