from collections import namedtuple

from cryptoconditions import crypto


CryptoKeypair = namedtuple('CryptoKeypair', ('signing_key', 'verifying_key'))


def generate_keypair():
    """Generates a cryptographic key pair.

    Returns:
        :class:`~bigchaindb_driver.crypto.CryptoKeypair`: A
        :obj:`collections.namedtuple` with named fields
        :attr:`~bigchaindb_driver.crypto.CryptoKeypair.signing_key` and
        :attr:`~bigchaindb_driver.crypto.CryptoKeypair.verifying_key`.

    """
    return CryptoKeypair(
        *(k.decode() for k in crypto.ed25519_generate_key_pair()))

[(6, 'collections.namedtuple', 'namedtuple', False, 'from collections import namedtuple\n'), (20, 'cryptoconditions.crypto.ed25519_generate_key_pair', 'crypto.ed25519_generate_key_pair', False, 'from cryptoconditions import crypto\n')]