aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-14 16:47:58 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-14 16:47:58 +0100
commit80de11163aa5c85392ef76a8cac2b6e318de1ffe (patch)
tree299b0baf63822b80e2999311ae0a73f1ce66dc32 /account.go
parentd5df7e8703b413de3ca441b7d46bd96aa93f4ffe (diff)
Add EC key
Diffstat (limited to 'account.go')
-rw-r--r--account.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/account.go b/account.go
index d1a5af1..9831db7 100644
--- a/account.go
+++ b/account.go
@@ -3,6 +3,7 @@ package acme
import (
"crypto"
"crypto/ecdsa"
+ "crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"encoding/base64"
@@ -37,6 +38,14 @@ func NewAccount(size int) (*Account, error) {
return newAccount(key)
}
+func NewAccountEC() (*Account, error) {
+ key, err := ecdsa.GenerateKey(elliptic.P384(), rand.Reader)
+ if err != nil {
+ return nil, err
+ }
+ return newAccount(key)
+}
+
func newAccount(key crypto.PrivateKey) (*Account, error) {
switch k := key.(type) {
case *rsa.PrivateKey: