Examples of CloudStackUserVO


Examples of com.cloud.bridge.model.CloudStackUserVO

    public CloudStackUserDaoImpl() {}

    @Override
    public String getSecretKeyByAccessKey( String accessKey ) {
        CloudStackUserVO user = null;
        String cloudSecretKey = null;

        SearchBuilder <CloudStackUserVO> searchByAccessKey = createSearchBuilder();
        searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
        searchByAccessKey.done();
        Transaction txn = Transaction.open(Transaction.CLOUD_DB);
        try {
            txn.start();
            SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
            sc.setParameters("apiKey", accessKey);
            user =  findOneBy(sc);
            if ( user != null && user.getSecretKey() != null) {
                // User secret key could be encrypted
                cloudSecretKey = DBEncryptionUtil.decrypt(user.getSecretKey());
            }
            return cloudSecretKey;
        } finally {
            txn.commit();
            txn.close();
View Full Code Here

Examples of com.cloud.bridge.model.CloudStackUserVO

    public CloudStackUserDaoImpl() {
    }

    @Override
    public String getSecretKeyByAccessKey(String accessKey) {
        CloudStackUserVO user = null;
        String cloudSecretKey = null;

        SearchBuilder<CloudStackUserVO> searchByAccessKey = createSearchBuilder();
        searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
        searchByAccessKey.done();
        TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
        try {
            txn.start();
            SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
            sc.setParameters("apiKey", accessKey);
            user = findOneBy(sc);
            if (user != null && user.getSecretKey() != null) {
                // User secret key could be encrypted
                cloudSecretKey = DBEncryptionUtil.decrypt(user.getSecretKey());
            }
            return cloudSecretKey;
        } finally {
            txn.commit();
            txn.close();
View Full Code Here

Examples of com.cloud.bridge.model.CloudStackUserVO

    public CloudStackUserDaoImpl() {}

    @Override
    public String getSecretKeyByAccessKey( String accessKey ) {
        CloudStackUserVO user = null;
        String cloudSecretKey = null;

        SearchBuilder <CloudStackUserVO> searchByAccessKey = createSearchBuilder();
        searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
        searchByAccessKey.done();
        TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
        try {
            txn.start();
            SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
            sc.setParameters("apiKey", accessKey);
            user =  findOneBy(sc);
            if ( user != null && user.getSecretKey() != null) {
                // User secret key could be encrypted
                cloudSecretKey = DBEncryptionUtil.decrypt(user.getSecretKey());
            }
            return cloudSecretKey;
        } finally {
            txn.commit();
            txn.close();
View Full Code Here

Examples of com.cloud.bridge.model.CloudStackUserVO

    public CloudStackUserDaoImpl() {}

    @Override
    public String getSecretKeyByAccessKey( String accessKey ) {
        CloudStackUserVO user = null;
        String cloudSecretKey = null;

        SearchBuilder <CloudStackUserVO> searchByAccessKey = createSearchBuilder();
        searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
        searchByAccessKey.done();
        Transaction txn = Transaction.open(Transaction.CLOUD_DB);
        try {
            txn.start();
            SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
            sc.setParameters("apiKey", accessKey);
            user =  findOneBy(sc);
            if ( user != null && user.getSecretKey() != null) {
                // if the cloud db is encrypted, decrypt the secret_key returned by cloud db before signature generation
                if( EncryptionSecretKeyCheckerUtil.useEncryption() ) {
                    StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor();
                    cloudSecretKey = encryptor.decrypt( user.getSecretKey() );
                } else {
                    cloudSecretKey = user.getSecretKey();
                }
            }
            return cloudSecretKey;
        } finally {
            txn.commit();
View Full Code Here

Examples of com.cloud.bridge.model.CloudStackUserVO

    public CloudStackUserDaoImpl() {}

    @Override
    public String getSecretKeyByAccessKey( String accessKey ) {
        CloudStackUserVO user = null;
        String cloudSecretKey = null;

        SearchBuilder <CloudStackUserVO> searchByAccessKey = createSearchBuilder();
        searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
        searchByAccessKey.done();
        Transaction txn = Transaction.open(Transaction.CLOUD_DB);
        try {
            txn.start();
            SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
            sc.setParameters("apiKey", accessKey);
            user =  findOneBy(sc);
            if ( user != null && user.getSecretKey() != null) {
                // if the cloud db is encrypted, decrypt the secret_key returned by cloud db before signature generation
                if( EncryptionSecretKeyCheckerUtil.useEncryption() ) {
                    StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor();
                    cloudSecretKey = encryptor.decrypt( user.getSecretKey() );
                } else {
                    cloudSecretKey = user.getSecretKey();
                }
            }
            return cloudSecretKey;
        } finally {
            txn.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.