add EC key generation.

This commit is contained in:
Christopher Dudley
2017-12-14 18:09:48 -05:00
committed by Jeff
parent 1647be123d
commit 64a7b8acc3
5 changed files with 83 additions and 0 deletions

View File

@@ -158,6 +158,21 @@ func TestGenerate(t *testing.T) {
}
}
func TestGenerateEC(t *testing.T) {
key, err := GenerateECKey(Prime256v1)
if err != nil {
t.Fatal(err)
}
_, err = key.MarshalPKIXPublicKeyPEM()
if err != nil {
t.Fatal(err)
}
_, err = key.MarshalPKCS1PrivateKeyPEM()
if err != nil {
t.Fatal(err)
}
}
func TestSign(t *testing.T) {
key, _ := GenerateRSAKey(1024)
data := []byte("the quick brown fox jumps over the lazy dog")