List of usage examples for javax.crypto SecretKey toString
public String toString()
From source file:tests.unit.configuration.ConfigurationTestCase.java
/** * @see junit.framework.TestCase#setUp() *//*from w ww . j av a2 s . c o m*/ @Override protected void setUp() throws Exception { super.setUp(); try { FileUtils.moveFile(new File(CryptoHelper.getKeystorePath() + File.separator + KEYSTORE_NAME), new File(CryptoHelper.getKeystorePath() + File.separator + KEYSTORE_NAME + ".orig")); } catch (Exception exc) { exc.printStackTrace(); fail(); } try { KeyStoreID keySid = new KeyStoreID("TEMP", KeyStoreUtils.DEFAULT_KEYSTORE_TYPE, "", "", KeyStoreUtils.DEFAULT_KEYSTORE_PROVIDER); KeyID keyid = new KeyID("TEMP", keySid, ""); keySid.setKeyStoreName(KEYSTORE_NAME); keySid.setKeyStorePwd(KEY_STORE_PWD); keyid.setKeyAlias(ALIAS_KEY_NAME); keyid.setKeyPwd(ALIAS_KEY_PWD); SecretKey secretKey = CryptoUtils.generateSecretKey(CryptoUtils.TRIPLE_DES_TYPE, KEY_STORE_PWD.getBytes()); System.out.println("***************************************"); System.out.println("Registering SecretKey: " + secretKey.getAlgorithm() + " " + secretKey.getFormat() + " " + secretKey.toString()); System.out.println("In: " + keyid); KeyStoreUtils.writeKey(CryptoHelper.getKeystorePath(), keyid, secretKey, null); CryptoHelper.resetCache(); } catch (Exception exc) { exc.printStackTrace(); throw exc; } }