private String paddKey(EncryptKey encryptKey) { String key = encryptKey.getStringValue(); int addChars = 16 - key.length(); if (addChars < 0) { return key.substring(0, 16); } else if (addChars > 0) { return key + padding.substring(0, addChars); } return key; }
private String paddKey(EncryptKey encryptKey) { String key = encryptKey.getStringValue(); int addChars = 16 - key.length(); if (addChars < 0) { return key.substring(0, 16); } else if (addChars > 0) { return key + padding.substring(0, addChars); } return key; }
private String paddKey(EncryptKey encryptKey) { String key = encryptKey.getStringValue(); int addChars = 16 - key.length(); if (addChars < 0) { return key.substring(0, 16); } else if (addChars > 0) { return key + padding.substring(0, addChars); } return key; }
/** * Add an encryption key bind parameter. */ private Param addEncryptKeyParam(String keyNamedParam) { 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); }
/** * Add an encryption key bind parameter. */ private Param addEncryptKeyParam(String keyNamedParam) { 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); }
/** * Add an encryption key bind parameter. */ private Param addEncryptKeyParam(String keyNamedParam) { 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); }
public void bindEncryptedProperties(DataBind dataBind) throws SQLException { if (encryptedProps != null){ for (int i = 0; i < encryptedProps.length; i++) { String key = encryptedProps[i].getEncryptKey().getStringValue(); dataBind.setString(key); } } }
public void bindEncryptedProperties(DataBind dataBind) throws SQLException { if (encryptedProps != null){ for (int i = 0; i < encryptedProps.length; i++) { String key = encryptedProps[i].getEncryptKey().getStringValue(); dataBind.setString(key); } } }
/** * Bind keys for encrypted properties if necessary returning the DataBind. */ DataBind bindEncryptedProperties(PreparedStatement stmt, Connection conn) throws SQLException { DataBind dataBind = new DataBind(dataTimeZone, stmt, conn); if (encryptedProps != null) { for (BeanProperty encryptedProp : encryptedProps) { String key = encryptedProp.getEncryptKey().getStringValue(); dataBind.setString(key); } } return dataBind; }
public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindValue(encryptKey); } request.addBindValue(value); }
public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindValue(encryptKey); } request.addBindValue(value); }
@Override public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindEncryptKey(encryptKey); } request.addBindValue(val); }
public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindValue(encryptKey); } String bindValue = getValue(val, caseInsensitive, type); request.addBindValue(bindValue); }
@Override public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindEncryptKey(encryptKey); } request.addBindValue(val()); }
public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindValue(encryptKey); } String bindValue = getValue(val, caseInsensitive, type); request.addBindValue(bindValue); }
@Override public void addBindValues(SpiExpressionRequest request) { ElPropertyValue prop = getElProp(request); if (prop != null && prop.isDbEncrypted()) { // bind the key as well as the value String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue(); request.addBindEncryptKey(encryptKey); } String bindValue = getValue(strValue(), caseInsensitive, type); request.addBindValue(bindValue); }
/** * Bind a value in a Insert SET clause. */ public void dmlBindWhere(BindableRequest request, boolean checkIncludes, Object bean) throws SQLException { if (checkIncludes && !request.isIncluded(prop)) { return; } Object value = null; if (bean != null) { value = prop.getValue(bean); } // get Encrypt key String encryptKeyValue = prop.getEncryptKey().getStringValue(); request.bind(value, prop, prop.getName(), false); request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****"); } }
/** * Bind a value in a Insert SET clause. */ public void dmlBindWhere(BindableRequest request, boolean checkIncludes, Object bean) throws SQLException { if (checkIncludes && !request.isIncluded(prop)) { return; } Object value = null; if (bean != null) { value = prop.getValue(bean); } // get Encrypt key String encryptKeyValue = prop.getEncryptKey().getStringValue(); request.bind(value, prop, prop.getName(), false); request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****"); } }
/** * Bind a value in a Insert SET clause. */ public void dmlBind(BindableRequest request, EntityBean bean) throws SQLException { Object value = null; if (bean != null) { value = prop.getValue(bean); } // get Encrypt key String encryptKeyValue = prop.getEncryptKey().getStringValue(); if (!bindEncryptDataFirst) { // H2 encrypt function ... different parameter order request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****"); } request.bindNoLog(value, prop); if (bindEncryptDataFirst) { // MySql, Postgres, Oracle request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****"); } }
/** * Bind a value in a Insert SET clause. */ public void dmlBind(BindableRequest request, boolean checkIncludes, Object bean) throws SQLException { if (checkIncludes && !request.isIncluded(prop)) { return; } Object value = null; if (bean != null) { value = prop.getValue(bean); } // get Encrypt key String encryptKeyValue = prop.getEncryptKey().getStringValue(); if (!bindEncryptDataFirst){ // H2 encrypt function ... different parameter order request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****"); } request.bindNoLog(value, prop, prop.getName(), true); if (bindEncryptDataFirst){ // MySql, Postgres, Oracle request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****"); } }