aboutsummaryrefslogtreecommitdiff
path: root/crypto.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto.go')
-rw-r--r--crypto.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto.go b/crypto.go
index f57296b..e3a2133 100644
--- a/crypto.go
+++ b/crypto.go
@@ -88,14 +88,8 @@ func NewKey(size int) (crypto.PrivateKey, error) {
return ecdsa.GenerateKey(elliptic.P384(), rand.Reader)
case 521:
return ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
- case 1024:
- return rsa.GenerateKey(rand.Reader, 1024)
- case 1536:
- return rsa.GenerateKey(rand.Reader, 1536)
- case 2048:
- return rsa.GenerateKey(rand.Reader, 2048)
- case 4096:
- return rsa.GenerateKey(rand.Reader, 4096)
+ case 1024, 1536, 2048, 4096, 8192:
+ return rsa.GenerateKey(rand.Reader, size)
default:
return nil, ErrKeySize
}