def generateRSAKey(bits, implementations=['openssl', 'python']):
 for implementation in implementations:
  if ((implementation == 'openssl') and cryptomath.m2cryptoLoaded):
   return OpenSSL_RSAKey.generate(bits)
  elif (implementation == 'python'):
   return Python_RSAKey.generate(bits)
 raise ValueError('No acceptable implementations')

def generateRSAKey ( bits , implementations = [ 'openssl' , 'python' ] ) : for implementation in implementations : if ( ( implementation == 'openssl' ) and cryptomath . m2cryptoLoaded ) : return OpenSSL_RSAKey . generate ( bits ) elif ( implementation == 'python' ) : return Python_RSAKey . generate ( bits ) raise ValueError ( 'No acceptable implementations' )
generate an rsa key with the specified bit length .