aboutsummaryrefslogtreecommitdiff
path: root/private_key_test.go
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2015-02-18 21:55:29 +0100
committerGibheer <gibheer@gmail.com>2015-02-18 21:55:29 +0100
commit23f83f3c6eee19349154a06bfb3cc48d85550216 (patch)
tree53151f105f0136f9eca223ac395686ba6a97aca2 /private_key_test.go
parent53be920308432fccbdddeef248e0bebed81877ba (diff)
add marshal test for public key
Diffstat (limited to 'private_key_test.go')
-rw-r--r--private_key_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/private_key_test.go b/private_key_test.go
index 0a3fd00..1d8f5ba 100644
--- a/private_key_test.go
+++ b/private_key_test.go
@@ -11,8 +11,8 @@ var (
)
// run the marshal test
-func RunMarshalTest(pk_type string, pk Pemmer, label string, t *testing.T) ([]byte, error) {
- marsh_pem, err := pk.MarshalPem()
+func RunMarshalTest(pk_type string, pe Pemmer, label string, t *testing.T) ([]byte, error) {
+ marsh_pem, err := pe.MarshalPem()
if err != nil {
t.Errorf("%s: marshal pem not working: %s", pk_type, err)
return nil, err
@@ -30,6 +30,10 @@ func RunMarshalTest(pk_type string, pk Pemmer, label string, t *testing.T) ([]by
func RunPrivateKeyTests(pk_type string, pk PrivateKey, t *testing.T) {
pu := pk.Public()
+ // TODO check return result of the marshalled public key
+ _, err := RunMarshalTest(pk_type + "-public", pu, PemLabelPublic, t)
+ if err != nil { return }
+
signature, err := pk.Sign(SignatureMessage)
if err != nil { t.Errorf("%s: error creating a signature: %s", pk_type, err) }