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
+7.1k Golang : Transform lisp or spinal case to Pascal case example
+15.6k Golang : Convert date format and separator yyyy-mm-dd to dd-mm-yyyy
+10.6k Golang : Get local time and equivalent time in different time zone
+13.3k Golang : Linear algebra and matrix calculation example
+6.4k CodeIgniter : form input set_value cause " to become & quot
+18.5k Golang : Set, Get and List environment variables
+6.7k Golang : Experimental emojis or emoticons icons programming language
+13.5k Golang : Count number of runes in string
+9.1k Golang : Get curl -I or head data from URL example
+10.4k Golang : Meaning of omitempty in struct's field tag
+14.6k Golang : Missing Bazaar command