@@ -0,0 +1,2718 @@
+//  Project name: FwiCore%0A//  File name   : FwiAesFactory.java%0A//%0A//  Author      : Phuc, Tran Huu%0A//  Created date: 8/17/15%0A//  Version     : 1.00%0A//  --------------------------------------------------------------%0A//  Copyright (C) 2012, 2015 Fiision Studio.%0A//  All Rights Reserved.%0A//  --------------------------------------------------------------%0A//%0A//  Permission is hereby granted, free of charge, to any person obtaining  a  copy%0A//  of this software and associated documentation files (the %22Software%22), to  deal%0A//  in the Software without restriction, including without limitation  the  rights%0A//  to use, copy, modify, merge,  publish,  distribute,  sublicense,  and/or  sell%0A//  copies of the Software,  and  to  permit  persons  to  whom  the  Software  is%0A//  furnished to do so, subject to the following conditions:%0A//%0A//  The above copyright notice and this permission notice shall be included in all%0A//  copies or substantial portions of the Software.%0A//%0A//  THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF  ANY  KIND,  EXPRESS  OR%0A//  IMPLIED, INCLUDING BUT NOT  LIMITED  TO  THE  WARRANTIES  OF  MERCHANTABILITY,%0A//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO  EVENT  SHALL  THE%0A//  AUTHORS OR COPYRIGHT HOLDERS  BE  LIABLE  FOR  ANY  CLAIM,  DAMAGES  OR  OTHER%0A//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  FROM,%0A//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  THE%0A//  SOFTWARE.%0A//%0A//%0A//  Disclaimer%0A//  __________%0A//  Although reasonable care has been taken to  ensure  the  correctness  of  this%0A//  software, this software should never be used in any application without proper%0A//  testing. Fiision Studio disclaim  all  liability  and  responsibility  to  any%0A//  person or entity with respect to any loss or damage caused, or alleged  to  be%0A//  caused, directly or indirectly, by the use of this software.%0A%0Apackage com.fiision.lib.key;%0A%0A%0Aimport com.fiision.lib.FwiCore.*;%0Aimport com.fiision.lib.utils.*;%0A%0Aimport java.security.*;%0A%0Aimport javax.crypto.*;%0A%0A%0Apublic final class FwiAesFactory %7B%0A%0A    /** Generate AES Key. */%0A    static public FwiAes generateAesKey(FwiAesSize size) %7B%0A%09%09return FwiAesFactory.generateAesKey(size, FwiUtils.randomTag());%0A%09%7D%0A%09static public FwiAes generateAesKey(FwiAesSize size, String keyTag) %7B%0A%09%09FwiAes aesKey = null;%0A%09%09try %7B%0A%09%09%09KeyGenerator aesGenerator = KeyGenerator.getInstance(%22AES%22);%0A%09%09%09SecureRandom sr = SecureRandom.getInstance(%22SHA1PRNG%22);%0A%09%09%09aesGenerator.init(size.length, sr);%0A%0A%09%09%09SecretKey k = aesGenerator.generateKey();%0A%09%09%09aesKey = new FwiAes(keyTag, k.getEncoded());%0A%09%09%7D%0A%09%09catch (Exception ex) %7B%0A%09%09%09aesKey = null;%0A%09%09%7D%0A%09%09finally %7B%0A            return aesKey;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add AesFactory.