def generate(bits, progress_func=None): """ Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. :param function progress_func: an optional function to call at key points in key generation (used by ``pyCrypto.PublicKey``). :returns: A new private key (`.RSAKey`) object """ signing_key = ECDSA.generate() key = ECDSAKey(vals=(signing_key, signing_key.get_verifying_key())) return key
def generate(bits, progress_func=None): """ Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. @param bits: number of bits the generated key should be. @type bits: int @param progress_func: an optional function to call at key points in key generation (used by C{pyCrypto.PublicKey}). @type progress_func: function @return: new private key @rtype: L{RSAKey} """ signing_key = ECDSA.generate() key = ECDSAKey(vals=(signing_key, signing_key.get_verifying_key())) return key