diff options
author | Gibheer <gibheer@gmail.com> | 2015-02-18 22:55:29 +0100 |
---|---|---|
committer | Gibheer <gibheer@gmail.com> | 2015-02-18 22:55:29 +0100 |
commit | 639a5379e9abf4a3f0d88464d1a229f8d5df14ae (patch) | |
tree | 3d05c242b4eaf8e17548c4ebe877a5765c52c0ed /types.go | |
parent | 577538a5ffb21b402b7ed53279d4b4dce30ace24 (diff) |
add sign and verification to ecdsa
This commit adds support to sign and verify messages using ecdsa.
Diffstat (limited to 'types.go')
-rw-r--r-- | types.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -14,8 +14,10 @@ type ( PrivateKey interface { // derive a public key from the private key Public() PublicKey - // sign a message with the private key - Sign(message []byte) ([]byte, error) + // Sign a message using the public key and the given hash method. + // To use a hash method, include the package + // import _ "crypto/sha512" + Sign(message []byte, hash crypto.Hash) ([]byte, error) // return the private key structure privateKey() crypto.PrivateKey @@ -25,7 +27,7 @@ type ( PublicKey interface { Pemmer // use the public key to verify a message against a signature - Verify(message []byte, signature []byte) (bool, error) + Verify(message []byte, signature []byte, hash crypto.Hash) (bool, error) } Pemmer interface { |