HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //usr/lib64/python2.6/site-packages/M2Crypto/PGP/RSA.py
"""M2Crypto PGP2 RSA.

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""

import sys
from M2Crypto import m2, RSA
_RSA = RSA
del RSA


class RSA(_RSA.RSA):
    pass


class RSA_pub(_RSA.RSA_pub):
    pass


def new_pub_key((e, n)):
    """
    Factory function that instantiates an RSA_pub object from a (e, n) tuple.

    'e' is the RSA public exponent; it is a string in OpenSSL's binary format,
    i.e., a number of bytes in big-endian.

    'n' is the RSA composite of primes; it is a string in OpenSSL's binary format,
    i.e., a number of bytes in big-endian.
    """ 
    import warnings
    warnings.warn('Deprecated. No maintainer for PGP. If you use this, please inform M2Crypto maintainer.', DeprecationWarning)

    rsa = m2.rsa_new()
    m2.rsa_set_e_bin(rsa, e)
    m2.rsa_set_n_bin(rsa, n)
    return RSA_pub(rsa, 1)