Пример #1
0
func Example_PrivateKey() {
	key, err := spki.GeneratePrivateKey("(ecdsa-sha2 (curve p256))")
	if err != nil {
		panic(err)
	}
	message := sexprs.Atom{Value: []byte("This is a message for signing")}
	signature, err := key.Sign(message)
	if err != nil {
		panic(err)
	}
	fmt.Println(signature)
	// // Output:
}
Пример #2
0
func TestGeneratePrivateKey(t *testing.T) {
	_, err := spki.GeneratePrivateKey("(ecdsa-sha2 (curve p256))")
	if err != nil {
		t.Fatal(err)
	}
}