Example usage for javax.crypto.spec DESedeKeySpec DES_EDE_KEY_LEN

List of usage examples for javax.crypto.spec DESedeKeySpec DES_EDE_KEY_LEN

Introduction

In this page you can find the example usage for javax.crypto.spec DESedeKeySpec DES_EDE_KEY_LEN.

Prototype

int DES_EDE_KEY_LEN

To view the source code for javax.crypto.spec DESedeKeySpec DES_EDE_KEY_LEN.

Click Source Link

Document

The constant which defines the length of a DESede key in bytes.

Usage

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;
}