Package net.sourceforge.javautil.common.encryption.impl

Examples of net.sourceforge.javautil.common.encryption.impl.SimpleEncryptionProvider


     
      key = ReflectionUtil.coerce(byte[].class, property.getValue(instance));
    }
   
    try {
      IEncryptionProvider provider = new SimpleEncryptionProvider(SimpleEncryptionKey.createUsing(Strength.STRONG, config == null ? "AES" : config.algorithm(), key));
      cache.put(clazz.getDescribedClass().getName(), new SoftReference<IEncryptionProvider>(provider));
      return provider;
    } catch (InvalidKeyException e) {
      throw ThrowableManagerRegistry.caught(e);
    }
View Full Code Here


  public StandardPasswordLocker(String name, IEncryptionProvider provider, IVirtualFile store, byte[] password) throws NoSuchAlgorithmException, InvalidKeyException {
    this.name = name;
    this.store = store;
    this.provider = provider;
    byte[] lockerPassword = provider.encrypt(password);
    this.passwordProvider = new SimpleEncryptionProvider(SimpleEncryptionKey.createUsing(Strength.STRONG, "AES", lockerPassword));
    this.load();
  }
View Full Code Here

   * @param key The key to use
   * @return The encrypted data
   */
  public static byte[] aesEncrypt (byte[] data, byte[] key) {
    try {
      return new SimpleEncryptionProvider(SimpleEncryptionKey.createUsing(Strength.STRONG, "AES", key)).encrypt(data);
    } catch (InvalidKeyException e) {
      throw ThrowableManagerRegistry.caught(e);
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.common.encryption.impl.SimpleEncryptionProvider

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.