cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject git commit: updated refs/heads/master to 9be7084
Date Fri, 17 Apr 2015 06:38:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 02031aba6 -> 9be70843f


removed unused static main in ConsoleProxyPasswordBasedEncryptor

This closes #11
This closes #10
This closes #176


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9be70843
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9be70843
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9be70843

Branch: refs/heads/master
Commit: 9be70843fdef7d16f6c828ae1bbe09fe8b93d725
Parents: 02031ab
Author: Rajani Karuturi <rajanikaruturi@gmail.com>
Authored: Fri Apr 17 09:54:03 2015 +0530
Committer: Rajani Karuturi <rajanikaruturi@gmail.com>
Committed: Fri Apr 17 12:07:04 2015 +0530

----------------------------------------------------------------------
 .../ConsoleProxyPasswordBasedEncryptor.java     | 30 --------------------
 .../ConsoleProxyPasswordBasedEncryptor.java     | 30 --------------------
 2 files changed, 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9be70843/server/src/com/cloud/servlet/ConsoleProxyPasswordBasedEncryptor.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/servlet/ConsoleProxyPasswordBasedEncryptor.java b/server/src/com/cloud/servlet/ConsoleProxyPasswordBasedEncryptor.java
index b64bb01..9d874e0 100644
--- a/server/src/com/cloud/servlet/ConsoleProxyPasswordBasedEncryptor.java
+++ b/server/src/com/cloud/servlet/ConsoleProxyPasswordBasedEncryptor.java
@@ -19,7 +19,6 @@ package com.cloud.servlet;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
 
 import javax.crypto.BadPaddingException;
 import javax.crypto.Cipher;
@@ -159,33 +158,4 @@ public class ConsoleProxyPasswordBasedEncryptor {
         }
     }
 
-    public static void main(String[] args) {
-        SecureRandom random;
-        try {
-            random = SecureRandom.getInstance("SHA1PRNG");
-            byte[] keyBytes = new byte[16];
-            random.nextBytes(keyBytes);
-
-            byte[] ivBytes = new byte[16];
-            random.nextBytes(ivBytes);
-
-            KeyIVPair keyIvPair = new KeyIVPair("8x/xUBgX0Up+3UEo39dSeG277JhVj31+ElHkN5+EC0Q=",
"Y2SUiIN6JXTdKNK/ZMDyVtLB7gAM9MCCiyrP1xd3bSQ=");
-            //keyIvPair.setKeyBytes(keyBytes);
-            //keyIvPair.setIvBytes(ivBytes);
-
-            Gson gson = new GsonBuilder().create();
-            ConsoleProxyPasswordBasedEncryptor encryptor = new ConsoleProxyPasswordBasedEncryptor(gson.toJson(keyIvPair));
-
-            String encrypted = encryptor.encryptText("Hello, world");
-
-            System.out.println("Encrypted result: " + encrypted);
-
-            String decrypted = encryptor.decryptText(encrypted);
-
-            System.out.println("Decrypted result: " + decrypted);
-
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9be70843/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyPasswordBasedEncryptor.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyPasswordBasedEncryptor.java
b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyPasswordBasedEncryptor.java
index 4ec2a72..c623aff 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyPasswordBasedEncryptor.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyPasswordBasedEncryptor.java
@@ -19,7 +19,6 @@ package com.cloud.consoleproxy;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
 
 import javax.crypto.BadPaddingException;
 import javax.crypto.Cipher;
@@ -165,33 +164,4 @@ public class ConsoleProxyPasswordBasedEncryptor {
         }
     }
 
-    public static void main(String[] args) {
-        SecureRandom random;
-        try {
-            random = SecureRandom.getInstance("SHA1PRNG");
-            byte[] keyBytes = new byte[16];
-            random.nextBytes(keyBytes);
-
-            byte[] ivBytes = new byte[16];
-            random.nextBytes(ivBytes);
-
-            KeyIVPair keyIvPair = new KeyIVPair("8x/xUBgX0Up+3UEo39dSeG277JhVj31+ElHkN5+EC0Q=",
"Y2SUiIN6JXTdKNK/ZMDyVtLB7gAM9MCCiyrP1xd3bSQ=");
-            //keyIvPair.setKeyBytes(keyBytes);
-            //keyIvPair.setIvBytes(ivBytes);
-
-            Gson gson = new GsonBuilder().create();
-            ConsoleProxyPasswordBasedEncryptor encryptor = new ConsoleProxyPasswordBasedEncryptor(gson.toJson(keyIvPair));
-
-            String encrypted = encryptor.encryptText("Hello, world");
-
-            System.out.println("Encrypted result: " + encrypted);
-
-            String decrypted = encryptor.decryptText(encrypted);
-
-            System.out.println("Decrypted result: " + decrypted);
-
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-        }
-    }
 }


Mime
View raw message