本文整理匯總了Java中org.openyu.commons.security.impl.SecurityProcessorImpl類的典型用法代碼示例。如果您正苦於以下問題:Java SecurityProcessorImpl類的具體用法?Java SecurityProcessorImpl怎麽用?Java SecurityProcessorImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SecurityProcessorImpl類屬於org.openyu.commons.security.impl包,在下文中一共展示了SecurityProcessorImpl類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: encryptWithProcessor
import org.openyu.commons.security.impl.SecurityProcessorImpl; //導入依賴的package包/類
public static byte[] encryptWithProcessor(final byte[] value) {
byte[] result = new byte[0];
//
// result = (byte[]) securityProcessorCacheFactory
// .execute(new CacheCallback<SecurityProcessor>() {
// public Object doInAction(SecurityProcessor obj)
// throws CacheException {
// try {
// return obj.encrypt(value);
// } catch (Exception ex) {
// throw new CacheException(ex);
// } finally {
// }
// }
// });
SecurityProcessor obj = new SecurityProcessorImpl();
obj.setSecurity(ConfigHelper.isSecurity());
obj.setSecurityKey(ConfigHelper.getSecurityKey());
obj.setSecurityType(ConfigHelper.getSecurityType());
result = obj.encrypt(value);
//
return result;
}
示例2: decryptWithProcessor
import org.openyu.commons.security.impl.SecurityProcessorImpl; //導入依賴的package包/類
public static byte[] decryptWithProcessor(final byte[] value) {
byte[] result = new byte[0];
//
// result = (byte[]) securityProcessorCacheFactory
// .execute(new CacheCallback<SecurityProcessor>() {
// public Object doInAction(SecurityProcessor obj)
// throws CacheException {
// try {
// return obj.decrypt(value);
// } catch (Exception ex) {
// throw new CacheException(ex);
// } finally {
// }
// }
// });
//
SecurityProcessor obj = new SecurityProcessorImpl();
obj.setSecurity(ConfigHelper.isSecurity());
obj.setSecurityKey(ConfigHelper.getSecurityKey());
obj.setSecurityType(ConfigHelper.getSecurityType());
result = obj.decrypt(value);
//
return result;
}