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
+12.5k Golang : HTTP response JSON encoded data
+18k Golang : How to log each HTTP request to your web server?
+7.3k Golang : How to iterate a slice without using for loop?
+9.7k Golang : Populate slice with sequential integers example
+15.9k Golang : Update database with GORM example
+8.3k Golang: Prevent over writing file with md5 hash
+20.2k Golang : Reset or rewind io.Reader or io.Writer
+6.1k PageSpeed : Clear or flush cache on web server
+12.6k Golang : Exit, terminating or aborting a program
+10.6k Golang : Select region of interest with mouse click and crop from image
+11.6k SSL : The certificate is not trusted because no issuer chain was provided
+12.7k Golang : Remove or trim extra comma from CSV