aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-19 17:38:36 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-19 17:38:36 +0100
commitd31f0aef1bc45ef78478a0195b1ab32cf5f5518e (patch)
tree3cee389508aac8fb9b3fac5baac798d5420d8b70 /account.go
parent5d38f751c2daaea13b860347dd01561ca8225261 (diff)
Collect mimes, change Signer interface to generic []byte
Diffstat (limited to 'account.go')
-rw-r--r--account.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/account.go b/account.go
index 48849c4..393d27f 100644
--- a/account.go
+++ b/account.go
@@ -6,7 +6,6 @@ import (
"crypto/rand"
"crypto/rsa"
"encoding/base64"
- "encoding/json"
"io"
"strings"
@@ -53,16 +52,12 @@ func newAccount(key crypto.PrivateKey) (*Account, error) {
// Signer describes a signing interface
type Signer interface {
- Sign(interface{}, jose.NonceSource) (io.Reader, error)
+ Sign([]byte, jose.NonceSource) (io.Reader, error)
KeyAuth(string) (string, error)
}
// Sign implements Signer interface
-func (a *Account) Sign(v interface{}, n jose.NonceSource) (io.Reader, error) {
- msg, err := json.Marshal(v)
- if err != nil {
- return nil, err
- }
+func (a *Account) Sign(msg []byte, n jose.NonceSource) (io.Reader, error) {
a.signer.SetNonceSource(n)
obj, err := a.signer.Sign(msg)
if err != nil {