1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-18 12:11:40 +00:00

DB update script 6

This commit is contained in:
jendib
2013-08-20 18:55:49 +02:00
parent 00b00f0d0c
commit 906de329ae
7 changed files with 17 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ import javax.crypto.spec.PBEKeySpec;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import com.google.common.base.Strings;
/**
* Encryption utilities.
*
@@ -47,6 +49,9 @@ public class EncryptionUtil {
*/
public static InputStream encryptStream(InputStream is, String privateKey) throws Exception {
checkBouncyCastleProvider();
if (Strings.isNullOrEmpty(privateKey)) {
throw new IllegalArgumentException("The private key is null or empty");
}
return new CipherInputStream(is, getCipher(privateKey, Cipher.ENCRYPT_MODE));
}

View File

@@ -1 +1 @@
db.version=5
db.version=6

View File

@@ -0,0 +1,2 @@
alter table T_USER add column USE_PRIVATEKEY_C varchar(100) default '' not null;
update T_CONFIG set CFG_VALUE_C='6' where CFG_ID_C='DB_VERSION';