4096-bit RSA keys by default. Auto-regen keys if a cert or key is missing.

This commit is contained in:
Mikkel Krautz 2011-11-08 16:12:54 +01:00
parent 3014d5fe39
commit 53db9cd2fb
3 changed files with 34 additions and 22 deletions

View file

@ -17,7 +17,7 @@ import (
"time"
)
// Generate a 2048-bit RSA keypair and a Grumble auto-generated X509
// Generate a 4096-bit RSA keypair and a Grumble auto-generated X509
// certificate. Output PEM-encoded DER representations of the resulting
// certificate and private key to certpath and keypath.
func GenerateSelfSignedCert(certpath, keypath string) (err error) {
@ -34,7 +34,7 @@ func GenerateSelfSignedCert(certpath, keypath string) (err error) {
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
}
priv, err := rsa.GenerateKey(rand.Reader, 2048)
priv, err := rsa.GenerateKey(rand.Reader, 4096)
if err != nil {
return err
}