Go Private Public RSA

package main import ( “crypto/rand” “crypto/rsa” “crypto/x509” “encoding/pem” “fmt” ) type ( App struct { Private *rsa.PublicKey Public []byte //Secret []byte } ) func main() { app := new(App) if err := app.GenerateKey(); err != nil { panic(err) } privpem := pem.EncodeToMemory( &pem.Block{ Type: “RSA PRIVATE KEY”, Bytes: x509.MarshalPKCS1PrivateKey(app.Private), }, ) fmt.Printf(“%s\n”, privpem) pubbytes, err […]