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.3k Golang : How to iterate a slice without using for loop?
+10.7k Golang : Get currencies exchange rates example
+11.1k Golang : Fix go.exe is not compatible with the version of Windows you're running
+9.4k Golang : Create unique title slugs example
+5.1k Golang : Check if a word is countable or not
+10.2k Golang : Random Rune generator
+4.3k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+7.5k Golang : How to handle file size larger than available memory panic issue
+7.9k Javascript : Put image into Chrome browser's console
+13.4k Golang : Read from buffered reader until specific number of bytes
+19.5k Golang : How to Set or Add Header http.ResponseWriter?
+5.3k Javascript : Change page title to get viewer attention