示例#1
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)
示例#2
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)
示例#3
0
文件: EC.py 项目: pmp-p/M2Crypto
def get_builtin_curves():
    # type: () -> Tuple[Dict[str, Union[int, str]]]
    return m2.ec_get_builtin_curves()
示例#4
0
文件: EC.py 项目: mcepl/M2Crypto
def get_builtin_curves():
    # type: () -> Tuple[Dict[str, Union[int, str]]]
    return m2.ec_get_builtin_curves()
示例#5
0
文件: EC.py 项目: rodrigc/m2crypto
def get_builtin_curves():
    return m2.ec_get_builtin_curves()