aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
Diffstat (limited to 'account.go')
-rw-r--r--account.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/account.go b/account.go
index fffc339..8ae343b 100644
--- a/account.go
+++ b/account.go
@@ -5,8 +5,10 @@ import (
"crypto/rsa"
"encoding/json"
"fmt"
+ "io"
"io/ioutil"
"net/mail"
+ "strings"
"github.com/square/go-jose"
)
@@ -67,10 +69,10 @@ func (a Account) SaveAccount(fname string) error {
// Signer describes a signing interface
type Signer interface {
- Sign([]byte, jose.NonceSource) ([]byte, error)
+ Sign([]byte, jose.NonceSource) (io.Reader, error)
}
-func (a *Account) Sign(msg []byte, n jose.NonceSource) ([]byte, error) {
+func (a *Account) Sign(msg []byte, n jose.NonceSource) (io.Reader, error) {
if a.signer == nil {
var err error
a.signer, err = jose.NewSigner(jose.RS256, a.PrivKey)
@@ -83,7 +85,7 @@ func (a *Account) Sign(msg []byte, n jose.NonceSource) ([]byte, error) {
if err != nil {
return nil, err
}
- return []byte(obj.FullSerialize()), nil
+ return strings.NewReader(obj.FullSerialize()), nil
}
func (a *Account) ParseSigned(msg []byte) ([]byte, error) {