Package fr.jayasoft.crypto

Examples of fr.jayasoft.crypto.Crypto


    private static org.apache.log4j.Logger LOGGER = LoggingManager.getLogger(DecoderFactory.class.getName());
   
    public static Decoder getDecoder(String dir, String keyFile) {
        String cryptoAlgo = System.getProperty("crypto.algo", CryptoFactory.DES);
        byte[] keyBytes = readKey(dir, keyFile);
        Crypto cr = CryptoFactory.get(cryptoAlgo);
        Object key = cr.getKeyGenerator().getDecodingKey(keyBytes);
       
        if (key==null) {
            LOGGER.warn("creation of a " + cryptoAlgo + " decoder has failed");
            return null;
        }
        LOGGER.info("Decoder built from key in file: " + keyFile);
        return cr.newDecoder(key);
    }
View Full Code Here

TOP

Related Classes of fr.jayasoft.crypto.Crypto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.