'Initialize.
:param directory: Directory Resource (`.messages.Directory`) or
URI from which the resource will be downloaded.'

def __init__(self, directory, key, alg=jose.RS256, verify_ssl=True, net=None):

    self.key = key
    self.net = (ClientNetwork(key, alg, verify_ssl) if (net is None) else net)
    if isinstance(directory, six.string_types):
        self.directory = messages.Directory.from_json(self.net.get(directory).json())
    else:
        self.directory = directory
