Example usage for org.apache.commons.crypto.random CryptoRandomFactory getCryptoRandom

List of usage examples for org.apache.commons.crypto.random CryptoRandomFactory getCryptoRandom

Introduction

In this page you can find the example usage for org.apache.commons.crypto.random CryptoRandomFactory getCryptoRandom.

Prototype

public static CryptoRandom getCryptoRandom() throws GeneralSecurityException 

Source Link

Document

Gets a CryptoRandom instance using the default implementation as defined by #CLASSES_DEFAULT

Usage

From source file:de.siegmar.securetransfer.component.Cryptor.java

private CryptoRandom initRandom() {
    try {/*from  ww w .java  2s .c  o  m*/
        final CryptoRandom cryptoRandom = CryptoRandomFactory.getCryptoRandom();
        LOG.info("Initialized {} for secure random generation", cryptoRandom.getClass());
        return cryptoRandom;
    } catch (final GeneralSecurityException e) {
        throw new IllegalStateException(e);
    }
}