aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-26 23:55:40 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-26 23:55:40 +0100
commit36fbcdd2bdef6176538367f71fa25609b18a705c (patch)
tree1962aec744066d2ac183c7533d9b20c6f8ded23c /account.go
parent0c1b5b987647bb264a1027565357b1377e3f5fad (diff)
Unexport Key
Diffstat (limited to 'account.go')
-rw-r--r--account.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/account.go b/account.go
index a914db4..37b8ec0 100644
--- a/account.go
+++ b/account.go
@@ -16,8 +16,8 @@ const KeySize = 2048
// Account ...
type Account struct {
- Contact Contacts `json:"contact"`
- PrivKey *rsa.PrivateKey `json:"key"`
+ Contact Contacts
+ privKey *rsa.PrivateKey
signer jose.Signer
nonce chan string
}
@@ -28,7 +28,7 @@ func NewAccount(key *rsa.PrivateKey) (*Account, error) {
if err != nil {
return nil, err
}
- return &Account{PrivKey: key, signer: signer}, nil
+ return &Account{privKey: key, signer: signer}, nil
}
func (a *Account) AddMail(email string) error {
@@ -64,7 +64,7 @@ func (a *Account) Sign(msg []byte, n jose.NonceSource) (io.Reader, error) {
}
func (a *Account) Thumb(token string) (string, error) {
- k := &jose.JsonWebKey{Key: a.PrivKey.Public(), Algorithm: "RSA"}
+ k := &jose.JsonWebKey{Key: a.privKey.Public(), Algorithm: "RSA"}
thumb, err := k.Thumbprint(crypto.SHA256)
if err != nil {
return "", err