public static void checkCipherList(String[] cipherCandidates) { for (int i = 0; i < cipherCandidates.length; i++) getEntry(cipherCandidates[i]); }
public static int getBlockSize(String type) { CipherEntry ce = getEntry(type); return ce.blocksize; }
public static void checkCipherList(String[] cipherCandidates) { for (int i = 0; i < cipherCandidates.length; i++) getEntry(cipherCandidates[i]); }
public static int getBlockSize(String type) { CipherEntry ce = getEntry(type); return ce.blocksize; }
public static int getKeySize(String type) { CipherEntry ce = getEntry(type); return ce.keysize; } }
public static void checkCipherList(String[] cipherCandidates) { for (int i = 0; i < cipherCandidates.length; i++) getEntry(cipherCandidates[i]); }
public static int getBlockSize(String type) { CipherEntry ce = getEntry(type); return ce.blocksize; }
public static int getKeySize(String type) { CipherEntry ce = getEntry(type); return ce.keysize; } }
public static int getKeySize(String type) { CipherEntry ce = getEntry(type); return ce.keysize; } }
public static BlockCipher createCipher(String type, boolean encrypt, byte[] key, byte[] iv) { try { CipherEntry ce = getEntry(type); Class cc = Class.forName(ce.cipherClass); BlockCipher bc = (BlockCipher) cc.newInstance(); if (type.endsWith("-cbc")) { bc.init(encrypt, key); return new CBCMode(bc, iv, encrypt); } else if (type.endsWith("-ctr")) { bc.init(true, key); return new CTRMode(bc, iv, encrypt); } throw new IllegalArgumentException("Cannot instantiate " + type); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate " + type); } }
public static BlockCipher createCipher(String type, boolean encrypt, byte[] key, byte[] iv) { try { CipherEntry ce = getEntry(type); Class cc = Class.forName(ce.cipherClass); BlockCipher bc = (BlockCipher) cc.newInstance(); if (type.endsWith("-cbc")) { bc.init(encrypt, key); return new CBCMode(bc, iv, encrypt); } else if (type.endsWith("-ctr")) { bc.init(true, key); return new CTRMode(bc, iv, encrypt); } throw new IllegalArgumentException("Cannot instantiate " + type); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate " + type); } }
public static BlockCipher createCipher(String type, boolean encrypt, byte[] key, byte[] iv) { try { CipherEntry ce = getEntry(type); Class cc = Class.forName(ce.cipherClass); BlockCipher bc = (BlockCipher) cc.newInstance(); if (type.endsWith("-cbc")) { bc.init(encrypt, key); return new CBCMode(bc, iv, encrypt); } else if (type.endsWith("-ctr")) { bc.init(true, key); return new CTRMode(bc, iv, encrypt); } throw new IllegalArgumentException("Cannot instantiate " + type); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate " + type); } }