Merge pull request #292 from octobot-dev/increment-rsa-key-length

Enhancement: Increment RSA key size to 2048.
This commit is contained in:
Juan Ignacio Fiorentino 2018-10-05 12:46:54 -03:00 committed by GitHub
commit 4c7bddfd02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,5 @@
from Cryptodome.PublicKey import RSA
from django.core.management.base import BaseCommand
from oidc_provider.models import RSAKey
@ -9,7 +8,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
try:
key = RSA.generate(1024)
key = RSA.generate(2048)
rsakey = RSAKey(key=key.exportKey('PEM').decode('utf8'))
rsakey.save()
self.stdout.write(u'RSA key successfully created with kid: {0}'.format(rsakey.kid))