def load_keypair(keypair_file):
    '''load a keypair from a keypair file. We add attributes key (the raw key)
       and public_key (the url prepared public key) to the client.

       Parameters
       ==========
       keypair_file: the pem file to load.
    '''
    from Crypto.PublicKey import RSA

    # Load key
    with open(keypair_file, 'rb') as filey:
        key = RSA.import_key(filey.read())

    return quote_plus(key.publickey().exportKey().decode('utf-8'))