本文整理汇总了Java中org.oscm.encrypter.AESEncrypter.decrypt方法的典型用法代码示例。如果您正苦于以下问题:Java AESEncrypter.decrypt方法的具体用法?Java AESEncrypter.decrypt怎么用?Java AESEncrypter.decrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscm.encrypter.AESEncrypter
的用法示例。
在下文中一共展示了AESEncrypter.decrypt方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVOServiceFromTrigger
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
private VOService getVOServiceFromTrigger(TriggerProcess triggerProcess,
DocumentBuilder builder, XPathExpression serviceIdXpath) {
TriggerProcessParameter triggerProcessParameter = triggerProcess
.getParamValueForName(TriggerProcessParameterName.PRODUCT);
String product;
try {
product = AESEncrypter
.decrypt(triggerProcessParameter.getSerializedValue());
} catch (GeneralSecurityException e) {
product = triggerProcessParameter.getSerializedValue();
}
String serviceId = retrieveValueByXpath(product, builder,
serviceIdXpath);
if (serviceId == null) {
return null;
}
VOService voService = new VOService();
voService.setServiceId(serviceId);
return voService;
}
示例2: getVOSubscriptionFromTrigger
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
private VOSubscription getVOSubscriptionFromTrigger(
TriggerProcess triggerProcess, DocumentBuilder builder,
XPathExpression subscriptionXpath) {
TriggerProcessParameter triggerProcessParameter = triggerProcess
.getParamValueForName(
org.oscm.types.enumtypes.TriggerProcessParameterName.SUBSCRIPTION);
String subscription;
try {
subscription = AESEncrypter
.decrypt(triggerProcessParameter.getSerializedValue());
} catch (GeneralSecurityException e) {
subscription = triggerProcessParameter.getSerializedValue();
}
String subsId = retrieveValueByXpath(subscription, builder,
subscriptionXpath);
if (subsId == null) {
return null;
}
VOSubscription voSubscription = new VOSubscription();
voSubscription.setSubscriptionId(subsId);
return voSubscription;
}
示例3: toXml
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
@Test
public void toXml() throws Exception {
AESEncrypter.generateKey();
// given
Map<String, String> map = new HashMap<>();
map.put("a", "a1");
map.put("b", "b1");
// when
String xml = XMLSerializer.toXml(map);
xml = AESEncrypter.decrypt(xml);
// then
assertTrue(xml.contains("a"));
assertTrue(xml.contains("a1"));
assertTrue(xml.contains("b"));
assertTrue(xml.contains("b1"));
}
示例4: toObjectUnencrypted
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
@Test
public void toObjectUnencrypted() throws Exception {
AESEncrypter.generateKey();
// given
Map<String, String> map = new HashMap<>();
map.put("a", "a1");
map.put("b", "b1");
String xml = XMLSerializer.toXml(map);
String decrypted = AESEncrypter.decrypt(xml);
// when
Map<String, String> map2 = (Map<String, String>) XMLSerializer
.toObject(decrypted);
// then
assertEquals(map.size(), map2.size());
assertTrue(map2.containsKey("a"));
assertTrue(map2.containsKey("b"));
assertEquals("a1", map2.get("a"));
assertEquals("b1", map2.get("b"));
}
示例5: toObject
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public static Object toObject(String xml) {
Object result = null;
XMLDecoder decoder = null;
try {
byte[] bytes;
if (xml.contains("<")) {
bytes = xml.getBytes();
} else {
String decrypted = AESEncrypter.decrypt(xml);
bytes = decrypted.getBytes();
}
decoder = new XMLDecoder(new ByteArrayInputStream(bytes));
result = decoder.readObject();
} catch (Exception e) {
LOGGER.logError(Log4jLogger.SYSTEM_LOG, e,
LogMessageIdentifier.ERROR);
} finally {
if (decoder != null) {
decoder.close();
}
}
return result;
}
示例6: getDecryptedValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public String getDecryptedValue() throws BadResultException {
try {
return isEncrypted() ? AESEncrypter.decrypt(attributeValue)
: attributeValue;
} catch (GeneralSecurityException e) {
throw new BadResultException(String.format(
"Attribute for key '%s' could not be decrypted",
getAttributeKey()));
}
}
示例7: getDecryptedValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public String getDecryptedValue() throws BadResultException {
try {
return isEncrypted() ? AESEncrypter.decrypt(parameterValue)
: parameterValue;
} catch (GeneralSecurityException e) {
throw new BadResultException(String.format(
"Parameter for key '%s' could not be decrypted",
getParameterKey()));
}
}
示例8: getDecryptedValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public String getDecryptedValue() throws ConfigurationException {
try {
return isEncrypted() ? AESEncrypter.decrypt(settingValue)
: settingValue;
} catch (GeneralSecurityException e) {
throw new ConfigurationException(
String.format("Setting for key '%s' could not be decrypted",
getSettingKey()));
}
}
示例9: getDefaultValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public String getDefaultValue() {
if (isEncrypted() && dataContainer.getDefaultValue() != null) {
try {
return AESEncrypter.decrypt(dataContainer.getDefaultValue());
} catch (GeneralSecurityException e) {
return null;
}
} else {
return dataContainer.getDefaultValue();
}
}
示例10: getDefaultValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
/**
* @return the defaultValue
*/
public String getDefaultValue() {
if (getValueType() == ParameterValueType.PWD
&& dataContainer.getDefaultValue() != null) {
try {
return AESEncrypter.decrypt(dataContainer.getDefaultValue());
} catch (GeneralSecurityException e) {
return null;
}
} else {
return dataContainer.getDefaultValue();
}
}
示例11: getValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public String getValue() {
if (isEncrypted() && dataContainer.getValue() != null) {
try {
return AESEncrypter.decrypt(dataContainer.getValue());
} catch (GeneralSecurityException e) {
return null;
}
} else {
return dataContainer.getValue();
}
}
示例12: getValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
/**
* Refer to {@link ParameterData#value}
*/
public String getValue() {
if (parameterDefinition != null
&& parameterDefinition.getValueType() == ParameterValueType.PWD
&& dataContainer.getValue() != null) {
try {
return AESEncrypter.decrypt(dataContainer.getValue());
} catch (GeneralSecurityException e) {
return null;
}
} else {
return dataContainer.getValue();
}
}
示例13: getUdaValue
import org.oscm.encrypter.AESEncrypter; //导入方法依赖的package包/类
public String getUdaValue() {
if (udaDefinition != null && udaDefinition.isEncrypted()
&& dataContainer.getUdaValue() != null) {
try {
return AESEncrypter.decrypt(dataContainer.getUdaValue());
} catch (GeneralSecurityException e) {
return null;
}
} else {
return dataContainer.getUdaValue();
}
}