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
+4.8k PHP : Extract part of a string starting from the middle
+11.7k Golang : Secure file deletion with wipe example
+9.5k Golang : Extract or copy items from map based on value
+5.6k PHP : Fix Call to undefined function curl_init() error
+6.2k Golang : Extract XML attribute data with attr field tag example
+7.8k Golang : Example of how to detect which type of script a word belongs to
+11.7k Golang : Gorilla web tool kit secure cookie example
+6.1k Fix ERROR 2003 (HY000): Can't connect to MySQL server on 'IP address' (111)
+13k Swift : Convert (cast) Int to String ?
+9.6k Golang : Quadratic example
+8.3k Golang: Prevent over writing file with md5 hash
+12.8k Golang : Convert int(year) to time.Time type