?? cipherfactory.java
字號:
/*
* Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.security;
import java.sql.SQLException;
import org.h2.constant.ErrorCode;
import org.h2.message.Message;
/**
* A factory to create new block cipher objects.
*/
public class CipherFactory {
public static BlockCipher getBlockCipher(String algorithm) throws SQLException {
if ("XTEA".equalsIgnoreCase(algorithm)) {
return new XTEA();
} else if ("AES".equalsIgnoreCase(algorithm)) {
return new AES();
} else {
throw Message.getSQLException(ErrorCode.UNSUPPORTED_CIPHER, algorithm);
}
}
public static SHA256 getHash(String algorithm) throws SQLException {
if ("SHA256".equalsIgnoreCase(algorithm)) {
return new SHA256();
} else {
throw Message.getInvalidValueException(algorithm, "algorithm");
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -