List of usage examples for javax.crypto.spec DESedeKeySpec DES_EDE_KEY_LEN
int DES_EDE_KEY_LEN
To view the source code for javax.crypto.spec DESedeKeySpec DES_EDE_KEY_LEN.
Click Source Link
From source file:org.alfresco.encryption.AlfrescoKeyStoreImpl.java
private byte[] generateKeyData() { try {//from ww w . j a v a 2s. c om SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); random.setSeed(System.currentTimeMillis()); byte bytes[] = new byte[DESedeKeySpec.DES_EDE_KEY_LEN]; random.nextBytes(bytes); return bytes; } catch (Exception e) { throw new RuntimeException("Unable to generate secret key", e); } }
From source file:org.alfresco.encryption.KeyStoreTests.java
public byte[] generateKeyData() throws NoSuchAlgorithmException { SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); random.setSeed(System.currentTimeMillis()); byte bytes[] = new byte[DESedeKeySpec.DES_EDE_KEY_LEN]; random.nextBytes(bytes);/*from w w w. j av a2 s . c o m*/ return bytes; }