From 32215b65656e77c2064fd0f0318bbc30ca96ce29 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 10 Dec 2015 14:17:23 +0100 Subject: WIP --- account.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'account.go') diff --git a/account.go b/account.go index a74f2d0..33f4e12 100644 --- a/account.go +++ b/account.go @@ -12,6 +12,7 @@ import ( // KeySize is a default RSA key size const KeySize = 2048 +// Account ... type Account struct { Contact []string `json:"contact"` PrivKey *rsa.PrivateKey `json:"key"` @@ -19,6 +20,7 @@ type Account struct { nonce chan string } +// NewAccount ... func NewAccount(email string, bits int) (*Account, error) { m, err := mail.ParseAddress(email) if err != nil { @@ -38,6 +40,11 @@ func LoadAccount(email string) (*Account, error) { return nil, nil } +// Signer describes a signing interface +type Signer interface { + Sign([]byte, jose.NonceSource) ([]byte, error) +} + func (a *Account) Sign(msg []byte, n jose.NonceSource) ([]byte, error) { if a.signer == nil { var err error -- cgit v1.2.3