aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
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: