com.alipay.api.DefaultDecryptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alipay-sdk-java Show documentation
Show all versions of alipay-sdk-java Show documentation
Alipay openapi SDK for Java
Copyright © 2018 杭州蚂蚁金服
All rights reserved.
版权所有 (C)杭州蚂蚁金服
http://open.alipay.com
/**
* Alipay.com Inc. Copyright (c) 2004-2018 All Rights Reserved.
*/
package com.alipay.api;
import com.alipay.api.internal.util.AlipayEncrypt;
/**
* @author liuqun.lq
* @version $Id: DefaultDecryptor.java, v 0.1 2018��07��03�� 12:35 liuqun.lq Exp $
*/
public class DefaultDecryptor implements Decryptor {
private String encryptKey;
public DefaultDecryptor(String encryptKey) {
this.encryptKey = encryptKey;
}
public String decrypt(String encryptContent, String encryptType, String charset) {
String decryptContent = null;
try {
decryptContent = AlipayEncrypt.decryptContent(encryptContent, encryptType,
encryptKey, charset);
} catch (AlipayApiException e) {
throw new RuntimeException(e);
}
return decryptContent;
}
/**
* Getter method for property encryptKey.
*
* @return property value of encryptKey
*/
public String getEncryptKey() {
return encryptKey;
}
/**
* Setter method for property encryptKey.
*
* @param encryptKey value to be assigned to property encryptKey
*/
public void setEncryptKey(String encryptKey) {
this.encryptKey = encryptKey;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy