Package org.nimbustools.api.services.security

Examples of org.nimbustools.api.services.security.KeyPair


    public CreateKeyPairResponseType createKeyPair(CreateKeyPairType createKeyPairRequestMsg)
            throws RemoteException {

        final String keyName = createKeyPairRequestMsg.getKeyName();

        final KeyPair keyPair;
        try {
            keyPair = keyManager.generateKey(keyName, containerInterface.getCaller());

        } catch (AuthorizationException e) {
            logger.error("Error generating keypair",e);
            throw new RemoteException("You do not have authorization to generate a keypair");
        } catch (OperationDisabledException e) {
            logger.error("Error generating keypair",e);
            throw new RemoteException("Key generation is not supported");
        } catch (KeyExistsException e) {
            logger.error("Error generating keypair",e);
            throw new RemoteException("A keypair named '"+keyName+"' already exists");
        }

        return new CreateKeyPairResponseType(
                keyPair.getFingerprint(),
                keyPair.getPrivateKey(),
                keyName, ""); // TODO do something real with requestId
    }
View Full Code Here


        }

        DescribeKeyPairsResponseItemType[] items =
                new DescribeKeyPairsResponseItemType[list.size()];
        for (int i=0; i<list.size(); i++) {
            KeyPair keyPair = list.get(i);
            items[i] = new DescribeKeyPairsResponseItemType(
                    keyPair.getFingerprint(), keyPair.getKeyName());
        }

        DescribeKeyPairsResponseInfoType respInfo = new DescribeKeyPairsResponseInfoType(items);
        return new DescribeKeyPairsResponseType(respInfo, "");
        // TODO do something real with requestId
View Full Code Here

TOP

Related Classes of org.nimbustools.api.services.security.KeyPair

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.