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.7k Golang : Underscore string example
+10.6k Golang : Allow Cross-Origin Resource Sharing request
+6.9k Default cipher that OpenSSL used to encrypt a PEM file
+7.3k Golang : Not able to grep log.Println() output
+4.6k JavaScript : Rounding number to decimal formats to display currency
+6.7k Golang : Experimental emojis or emoticons icons programming language
+14.6k Golang : GUI with Qt and OpenCV to capture image from camera
+6.4k CodeIgniter : form input set_value cause " to become & quot
+13.4k Golang : error parsing regexp: invalid or unsupported Perl syntax
+14.4k Golang : How to filter a map's elements for faster lookup
+18.2k Golang : Get command line arguments