Package unibg.overencrypt.client

Examples of unibg.overencrypt.client.AuthenticationClient


        String path = options.nonOptionArguments().get(1);
        logger.debug(path);

        OverEncryptClient client = new OverEncryptClient();
        AuthenticationClient pinManagementClient = new AuthenticationClient();
        PermissionsClient permissionsClient = new PermissionsClient();

        Response resp = client.readResponse(path);
        logger.debug("Response:\n===\n" + resp.toString() + "===");

        if (resp.getPrimitive() == ServerPrimitives.OE_DHKEYPAIRS) {
            exitWithError(1, "The user hasn't chosen a passphrase yet. "
                    + "Use the '" + new GenerateKeysCommand().getKeyword()
                    + "' command to choose one.");
        }

        String userId = resp.getValue("userId");
        String passphrase = "";

        if (options.has("p") || options.has("passphrase")) {
            passphrase = (String) options.valueOf("p");
        } else {
            exitWithError(2, "No passphrase supplied. Please use " +
                    "the -p/--passphrase option to supply a valid passphrase.");
        }

        client.deleteResponse(path);
        while (resp.getPrimitive() == ServerPrimitives.OE_AUTHENTICATION) {
            resp = pinManagementClient.checkPin(path, userId, passphrase);
            logger.debug("Response:\n===\n" + resp.toString() + "===");
        }

        if (resp.getPrimitive() == ServerPrimitives.OE_UPDATE_ALL_PERMS) {
            permissionsClient.updateAllPermissions(resp.getValue("friends"),
View Full Code Here


            exitWithError("No passphrase supplied. Please use "
                    + "the -p/--passphrase option to supply a valid passphrase.");
        }

        OverEncryptClient client = new OverEncryptClient();
        AuthenticationClient pinManagementClient = new AuthenticationClient();

        Response resp = client.waitForResponse(path);
        String userId = resp.getValue("userId");
        logger.debug("Response:\n===\n" + resp.toString() + "===");

        if (resp.getPrimitive() == ServerPrimitives.OE_DHKEYPAIRS) {
            resp = pinManagementClient.generateKeyPairs(path, userId,
                    passphrase);
            logger.debug("Response:\n===\n" + resp.toString() + "===");

            if (resp.getPrimitive() == ServerPrimitives.OE_SUCCESSFUL) {
                exitWithSuccess("Keys generated successfully.");
View Full Code Here

    @Override
    public void run(String[] args) {
        OptionSet options = new OptionParser().parse(args);
        String path = options.nonOptionArguments().get(1);

        Response response = new AuthenticationClient().logout(path);

        if (response.getPrimitive() == ServerPrimitives.OE_SUCCESSFUL) {
            exitWithSuccess("Logout successful. You can now unmount your "
                    + "WebDAV client.");
        } else {
View Full Code Here

TOP

Related Classes of unibg.overencrypt.client.AuthenticationClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.