def load_verifying_key(verifying_key, crypto_backend=default_backend()):
    """ Optional: crypto backend object from the "cryptography" python library
    """
    if not isinstance(crypto_backend, (Backend, MultiBackend)):
        raise ValueError('backend must be a valid Backend object')

    if isinstance(verifying_key, EllipticCurvePublicKey):
        return verifying_key
    elif isinstance(verifying_key, (str, unicode)):
        try:
            return load_der_public_key(
                verifying_key, backend=crypto_backend)
        except:
            try:
                return load_pem_public_key(
                    verifying_key, backend=crypto_backend)
            except Exception:
                raise ValueError('Invalid verifying key format')
    else:
        raise ValueError('Invalid verification key type')
def load_verifying_key ( verifying_key , crypto_backend = default_backend ( ) ) : if not isinstance ( crypto_backend , ( Backend , MultiBackend ) ) : raise ValueError ( 'backend must be a valid Backend object' ) if isinstance ( verifying_key , EllipticCurvePublicKey ) : return verifying_key elif isinstance ( verifying_key , ( str , unicode ) ) : try : return load_der_public_key ( verifying_key , backend = crypto_backend ) except : try : return load_pem_public_key ( verifying_key , backend = crypto_backend ) except Exception : raise ValueError ( 'Invalid verifying key format' ) else : raise ValueError ( 'Invalid verification key type' )
Optional: crypto backend object from the "cryptography" python library