Example #1
0
func gen() {
	priv, pub, err := signature.GenerateKeys()
	if err != nil {
		log.Fatal(err)
	}

	os.Stdout.Write(priv)
	os.Stdout.Write(pub)
}
Example #2
0
func TestGenerateKeys(t *testing.T) {
	priv, pub, err := signature.GenerateKeys()
	if err != nil {
		t.Fatal(err)
	}
	if !bytes.Contains(priv, []byte("PRIVATE KEY")) {
		t.Fatal("should be a private key")
	}
	if !bytes.Contains(pub, []byte("PUBLIC KEY")) {
		t.Fatal("should be a private key")
	}
}