com.aliyun.dc.opplat.sdk.api.common.DefaultSigner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dc-opplat-sdk-java Show documentation
Show all versions of dc-opplat-sdk-java Show documentation
Aliyun Open API SDK for Java
Copyright (C) Alibaba Cloud Computing
All rights reserved.
版权所有 (C)阿里云计算有限公司
http://www.aliyun.com
The newest version!
/**
* Alipay.com Inc. Copyright (c) 2004-2018 All Rights Reserved.
*/
package com.aliyun.dc.opplat.sdk.api.common;
import com.aliyun.dc.opplat.sdk.api.exception.OpplatApiException;
import com.aliyun.dc.opplat.sdk.api.utils.OpenApiSignature;
/**
* 默认签名器
*/
public class DefaultSigner implements Signer {
private String privateKey;
public DefaultSigner(String privateKey) {
this.privateKey = privateKey;
}
@Override
public String sign(String sourceContent, String signType, String charset) throws OpplatApiException {
return OpenApiSignature.rsaSign(sourceContent, this.privateKey, charset, signType);
}
/**
* Getter method for property privateKey.
*
* @return property value of privateKey
*/
public String getPrivateKey() {
return privateKey;
}
/**
* Setter method for property privateKey.
*
* @param privateKey value to be assigned to property privateKey
*/
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy