Golang encoding/pem.Encode() function example
package encoding/pem
Golang encoding/pem.Encode() function usage example
pemfile, _ := os.Create("certpem.pem")
var pemkey = &pem.Block{
Type : "RSA PRIVATE KEY",
Bytes : x509.MarshalPKCS1PrivateKey(privatekey)}
pem.Encode(pemfile, pemkey)
pemfile.Close()
See https://www.socketloop.com/tutorials/golang-create-x509-certificate-private-and-public-keys for full example
Reference :
Advertisement
Something interesting
Tutorials
+10.3k Golang : Detect number of faces or vehicles in a photo
+18.8k Golang : Delete duplicate items from a slice/array
+11k Golang : Generate random elements without repetition or duplicate
+9.4k Android Studio : Indicate progression with ProgressBar example
+17.2k Golang : When to use init() function?
+32.1k Golang : Validate email address with regular expression
+21.5k Golang : How to read float value from standard input ?
+8.1k Golang : Randomize letters from a string example
+17.6k Golang : delete and modify XML file content
+13.8k Generate salted password with OpenSSL example
+16.6k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+12.1k Golang : md5 hash of a string