當前位置: 首頁>>代碼示例>>Java>>正文


Java AESEncrypter.decrypt方法代碼示例

本文整理匯總了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;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:21,代碼來源:TriggerServiceBean.java

示例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;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:23,代碼來源:TriggerServiceBean.java

示例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"));
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:21,代碼來源:XMLSerializerTest.java

示例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"));
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:25,代碼來源:XMLSerializerTest.java

示例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;
}
 
開發者ID:servicecatalog,項目名稱:development,代碼行數:24,代碼來源:XMLSerializer.java

示例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()));
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:11,代碼來源:InstanceAttribute.java

示例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()));
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:11,代碼來源:InstanceParameter.java

示例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()));
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:11,代碼來源:ConfigurationSetting.java

示例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();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:12,代碼來源:UdaDefinition.java

示例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();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:16,代碼來源:ParameterDefinition.java

示例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();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:12,代碼來源:ModifiedUda.java

示例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();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:17,代碼來源:Parameter.java

示例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();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:13,代碼來源:Uda.java


注:本文中的org.oscm.encrypter.AESEncrypter.decrypt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。