Package com.avaje.ebean.config

Examples of com.avaje.ebean.config.EncryptKey


  @Test
  public void test() {

    SimpleAesEncryptor e = new SimpleAesEncryptor();

    EncryptKey key = new BasicEncryptKey("hello");

    byte[] data = "test123".getBytes();

    byte[] ecData = e.encrypt(data, key);
    System.out.println(Arrays.toString(ecData));
View Full Code Here


        this.column = column;
    }
   
    public byte[] encrypt(byte[] data){
   
        EncryptKey key = encryptKeyManager.getEncryptKey(table, column);
        return encryptor.encrypt(data, key);
    }
View Full Code Here

        return encryptor.encrypt(data, key);
    }

    public byte[] decrypt(byte[] data){
       
        EncryptKey key = encryptKeyManager.getEncryptKey(table, column);
        return encryptor.decrypt(data, key);
    }
View Full Code Here

        EncryptKey key = encryptKeyManager.getEncryptKey(table, column);
        return encryptor.decrypt(data, key);
    }
   
    public String decryptObject(byte[] data) {
        EncryptKey key = encryptKeyManager.getEncryptKey(table, column);
        return encryptor.decryptString(data, key);
    }
View Full Code Here

        EncryptKey key = encryptKeyManager.getEncryptKey(table, column);
        return encryptor.decryptString(data, key);
    }

    public <T> byte[] encryptObject(String formattedValue) {
        EncryptKey key = encryptKeyManager.getEncryptKey(table, column);
        return encryptor.encryptString(formattedValue, key);
    }
View Full Code Here

        int pos = keyNamedParam.indexOf(ENCRYPTKEY_GAP, ENCRYPTKEY_PREFIX_LEN);
       
        String tableName = keyNamedParam.substring(ENCRYPTKEY_PREFIX_LEN, pos);
        String columnName = keyNamedParam.substring(pos+ENCRYPTKEY_GAP_LEN);
       
        EncryptKey key = beanDescriptor.getEncryptKey(tableName, columnName);
        String strKey = key.getStringValue();
       
        return params.setEncryptionKey(keyNamedParam, strKey);
    }
View Full Code Here

TOP

Related Classes of com.avaje.ebean.config.EncryptKey

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.