예제 #1
0
def gen_params(curve):
    """
    Factory function that generates EC parameters and
    instantiates a EC object from the output.

    @param curve: This is the OpenSSL nid of the curve to use.
    """
    return EC(m2.ec_key_new_by_curve_name(curve), 1)
예제 #2
0
파일: EC.py 프로젝트: rodrigc/m2crypto
def gen_params(curve):
    """
    Factory function that generates EC parameters and
    instantiates a EC object from the output.

    @param curve: This is the OpenSSL nid of the curve to use.
    """
    assert curve in [x['NID'] for x in m2.ec_get_builtin_curves()], \
        'Elliptic curve %s is not available on this system.' % \
        m2.obj_nid2sn(curve)
    return EC(m2.ec_key_new_by_curve_name(curve), 1)
예제 #3
0
파일: EC.py 프로젝트: pmp-p/M2Crypto
def gen_params(curve):
    # type: (int) -> EC
    """
    Factory function that generates EC parameters and
    instantiates a EC object from the output.

    :param curve: This is the OpenSSL nid of the curve to use.
    """
    assert curve in [x['NID'] for x in m2.ec_get_builtin_curves()], \
        'Elliptic curve %s is not available on this system.' % \
        m2.obj_nid2sn(curve)
    return EC(m2.ec_key_new_by_curve_name(curve), 1)