aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-02 15:41:47 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-02 15:41:47 +0100
commit4264f1dd7f6993a47f011f2b4ec1d2c08de9e826 (patch)
treeb0786ab65d76c5a01c0199f2642b57cfe0ce7693
parent74658055757a2f85a20754d48ecec81921becef6 (diff)
Unify
-rw-r--r--account.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/account.go b/account.go
index b1312c0..ccaf8ff 100644
--- a/account.go
+++ b/account.go
@@ -19,7 +19,7 @@ const KeySize = 2048
// Account ...
type Account struct {
contact Contacts
- privKey *rsa.PrivateKey
+ key *rsa.PrivateKey
signer jose.Signer
nonce chan string
}
@@ -30,7 +30,7 @@ func NewAccount(key *rsa.PrivateKey) (*Account, error) {
if err != nil {
return nil, err
}
- return &Account{privKey: key, signer: signer}, nil
+ return &Account{key: key, signer: signer}, nil
}
func (a *Account) AddMail(email string) error {
@@ -74,7 +74,7 @@ func (a *Account) Sign(msg []byte, n jose.NonceSource) (io.Reader, error) {
}
func (a *Account) Thumb() (string, error) {
- k := &jose.JsonWebKey{Key: a.privKey.Public(), Algorithm: "RSA"}
+ k := &jose.JsonWebKey{Key: a.key.Public(), Algorithm: "RSA"}
thumb, err := k.Thumbprint(crypto.SHA256)
if err != nil {
return "", err
@@ -100,5 +100,5 @@ func (a *Account) Save(fname string) error {
return err
}
defer fd.Close()
- return SaveKey(fd, a.privKey)
+ return SaveKey(fd, a.key)
}