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
+9.1k Golang : Intercept and compare HTTP response code example
+5.7k List of Golang XML tutorials
+10.7k Golang : Underscore string example
+16.5k Golang : File path independent of Operating System
+25.3k Golang : Convert uint value to string type
+7k Golang : Find the shortest line of text example
+32.2k Golang : Convert []string to []byte examples
+9.1k Golang : How to capture return values from goroutines?
+9.4k Golang : Play .WAV file from command line
+17.7k How to enable MariaDB/MySQL logs ?