Exemplo n.º 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.
    """
    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)
Exemplo n.º 2
0
Arquivo: EC.py Projeto: 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)
Exemplo n.º 3
0
Arquivo: EC.py Projeto: pmp-p/M2Crypto
def get_builtin_curves():
    # type: () -> Tuple[Dict[str, Union[int, str]]]
    return m2.ec_get_builtin_curves()
Exemplo n.º 4
0
Arquivo: EC.py Projeto: mcepl/M2Crypto
def get_builtin_curves():
    # type: () -> Tuple[Dict[str, Union[int, str]]]
    return m2.ec_get_builtin_curves()
Exemplo n.º 5
0
def get_builtin_curves():
    return m2.ec_get_builtin_curves()