Package io.fathom.cloud.openstack.client.keystore

Examples of io.fathom.cloud.openstack.client.keystore.OpenstackKeystoreClient


    OpenstackKeystoreClient keystore;

    public OpenstackKeystoreClient getKeystore() throws RestClientException {
        if (keystore == null) {
            URI uri = getEndpoint(OpenstackKeystoreClient.SERVICE_TYPE);
            keystore = new OpenstackKeystoreClient(tokenProvider.getHttpClient(), uri, tokenProvider);
        }
        return keystore;
    }
View Full Code Here


    public OpenstackSecretKeys(OpenstackClient client) {
        this.client = client;
    }

    private Map<String, Secret> collectKeys() throws RestClientException {
        OpenstackKeystoreClient keystore = client.getKeystore();

        Map<String, Secret> secrets = Maps.newHashMap();

        for (Secret secret : keystore.listSecrets()) {
            log.debug("Found secret: " + secret);

            String subject = secret.subject;
            if (Strings.isNullOrEmpty(subject)) {
                continue;
View Full Code Here

    // }
    // return file;
    // }

    String readSecret(Secret secret) throws RestClientException {
        OpenstackKeystoreClient keystore = client.getKeystore();

        byte[] certificate = keystore.getSecret(secret.id, Secret.CERTIFICATE);
        byte[] privateKey = keystore.getSecret(secret.id, Secret.PRIVATE_KEY);

        // We assume PEM format
        String pem = new String(certificate, Charsets.UTF_8) + "\n" + new String(privateKey, Charsets.UTF_8);
        return pem;
    }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.openstack.client.keystore.OpenstackKeystoreClient

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.