@@ -66,21 +66,20 @@ def sha512_digest(msg):
6666
6767def  generate_and_store_rsa_key (key_size = 2048 , filename = 'rsa.key' ,
6868                               passphrase = '' ):
69-     private_key  =  rsa .generate_private_key (public_exponent   =   65537 ,
70-                                            key_size   =   key_size ,
71-                                            backend   =   default_backend ())
69+     private_key  =  rsa .generate_private_key (public_exponent = 65537 ,
70+                                            key_size = key_size ,
71+                                            backend = default_backend ())
7272
7373    with  open (filename , "wb" ) as  keyfile :
7474        if  passphrase :
7575            pem  =  private_key .private_bytes (
76-                 encoding  =  serialization .Encoding .PEM ,
77-                 format  =  serialization .PrivateFormat .PKCS8 ,
78-                 encryption_algorithm  =  serialization .BestAvailableEncryption (
79-                     passphrase ))
76+                 encoding = serialization .Encoding .PEM ,
77+                 format = serialization .PrivateFormat .PKCS8 ,
78+                 encryption_algorithm = serialization .BestAvailableEncryption (passphrase ))
8079        else :
8180            pem  =  private_key .private_bytes (
82-                 encoding   =   serialization .Encoding .PEM ,
83-                 format   =   serialization .PrivateFormat .PKCS8 ,
81+                 encoding = serialization .Encoding .PEM ,
82+                 format = serialization .PrivateFormat .PKCS8 ,
8483                encryption_algorithm = serialization .NoEncryption ())
8584        keyfile .write (pem )
8685        keyfile .close ()
@@ -968,7 +967,7 @@ def __eq__(self, other):
968967            if  isinstance (other .key , ec .EllipticCurvePublicKey ):
969968                if  self .key .curve  !=  other .key .curve :
970969                    return  False 
971-                 if  self .key .key_size  !=  other .key .key_size   :
970+                 if  self .key .key_size  !=  other .key .key_size :
972971                    return  False 
973972                if  self .key .public_numbers () !=  other .key .public_numbers ():
974973                    return  False 
@@ -978,7 +977,7 @@ def __eq__(self, other):
978977            if  isinstance (other .key , ec .EllipticCurvePrivateKey ):
979978                if  self .key .curve  !=  other .key .curve :
980979                    return  False 
981-                 if  self .key .key_size  !=  other .key .key_size   :
980+                 if  self .key .key_size  !=  other .key .key_size :
982981                    return  False 
983982                if  self .key .private_numbers () !=  other .key .private_numbers ():
984983                    return  False 
0 commit comments