public class SignitClient extends Object
2018-12-8 将此Client扩展为易企签所有开放平台应用公共使用的Client 2019-07-31 将成员变量全部ThreadLocal化,支持单例使用SignitClient对象,保证线程安全
| 构造器和说明 |
|---|
SignitClient(Authentication auth)
默认为:快捷签署客户端.
|
SignitClient(Authentication auth,
String envUrl)
已过时。
|
SignitClient(String appId,
String secretKey,
String appUrl)
应用客户端.
|
SignitClient(String appId,
String secretKey,
String appUrl,
int connectTimeout,
int readTimeout)
应用客户端.
|
public SignitClient(Authentication auth)
auth - 授权信息@Deprecated public SignitClient(Authentication auth, String envUrl)
auth - 授权信息envUrl - 应用环境public SignitClient(String appId, String secretKey, String appUrl)
appId - APP IDsecretKey - APP SecretappUrl - 应用请求路径@Deprecated public SignitClient setEnvironmentUrl(String url)
url - 应用环境public SignitClient setOauthUrl(String url)
url - 授权请求路径@Deprecated public SignitClient setSignUrl(String url)
url - 快捷签署请求路径public SignatureResponse sendSignatureRequest(SignatureRequest request) throws SignitException, IOException
request - 快捷签署请求SignitException - 易企签自定义异常IOException - 数据流异常public OauthData getOauthData(String apiKey, String secretKey, TokenType grantType, boolean autoSetRequestToken) throws SignitException
SignitExceptionpublic WebhookData parseWebhookData(String webhook)
webhook - webhook Json格式数据字符串public static WebhookResponse parseWebhookResponse(String webhook)
webhook - webhook Json格式字符串public <T extends AbstractSignitResponse> T getData(Class<T> responseClass, Map<String,String> params) throws SignitException
SignitExceptionpublic <T extends AbstractSignitResponse> T execute(AbstractSignitRequest<T> request) throws SignitException
SignitExceptionpublic <T extends AbstractSignitResponse> T executePost(AbstractSignitRequest<T> request, Map<String,String> params) throws SignitException
SignitExceptionpublic <T extends AbstractSignitResponse> T executePut(AbstractSignitRequest<T> request, Map<String,String> params) throws SignitException
SignitExceptionpublic static boolean verify(String signitSignature, String appId, HmacSignatureBuilder builder)
signitSignature - webhook响应header中x-signit-signature数据。服务器构建的hmac,用于客户端验证服务器appId - APP IDbuilder - hmac签名建造器public static boolean verify(String appId, String appSecretKey, byte[] body, javax.servlet.http.HttpServletRequest request) throws IOException
appId - APP IDappSecretKey - APP Secretbody - webhook响应具体数据。考虑到request中只能获取到body一次,故而需要在方法外获取并传递给此方法request - 服务端向客户端发起的请求IOException - 数据流异常Copyright © 2023. All rights reserved.