public AES() { try { KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(128); key = kg.generateKey(); init(); } catch (NoSuchAlgorithmException ex) { throw Unchecked.rethrow(ex); } catch (NoSuchPaddingException ex) { throw Unchecked.rethrow(ex); } catch (InvalidKeyException ex) { throw Unchecked.rethrow(ex); } catch (InvalidAlgorithmParameterException ex) { throw Unchecked.rethrow(ex); } }
public AES() { try { KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(128); key = kg.generateKey(); init(); } catch (NoSuchAlgorithmException ex) { throw Unchecked.rethrow(ex); } catch (NoSuchPaddingException ex) { throw Unchecked.rethrow(ex); } catch (InvalidKeyException ex) { throw Unchecked.rethrow(ex); } catch (InvalidAlgorithmParameterException ex) { throw Unchecked.rethrow(ex); } }
/** * 16 chars max, 128-bit encription */ public AES(SecretKey key) { try { this.key = key; init(); } catch (NoSuchAlgorithmException ex) { throw Unchecked.rethrow(ex); } catch (NoSuchPaddingException ex) { throw Unchecked.rethrow(ex); } catch (InvalidKeyException ex) { throw Unchecked.rethrow(ex); } catch (InvalidAlgorithmParameterException ex) { throw Unchecked.rethrow(ex); } }
/** * 16 chars max, 128-bit encription */ public AES(SecretKey key) { try { this.key = key; init(); } catch (NoSuchAlgorithmException ex) { throw Unchecked.rethrow(ex); } catch (NoSuchPaddingException ex) { throw Unchecked.rethrow(ex); } catch (InvalidKeyException ex) { throw Unchecked.rethrow(ex); } catch (InvalidAlgorithmParameterException ex) { throw Unchecked.rethrow(ex); } }