| | |
| | | |
| | | import cn.gistack.pwd.dto.CBCResultDTO; |
| | | import cn.gistack.pwd.dto.ResultDTO; |
| | | import cn.gistack.pwd.entity.VerifyOutput; |
| | | import cn.gistack.pwd.fegin.IPwdClient; |
| | | import cn.gistack.pwd.service.IPwdSendService; |
| | | import cn.gistack.pwd.service.IVerifyOutputService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | public class PwdClient implements IPwdClient { |
| | | |
| | | private final IPwdSendService pwdSendService; |
| | | private final IVerifyOutputService verifyOutputService; |
| | | |
| | | @Override |
| | | public R<CBCResultDTO> getCBCMacEncipher(String message) { |
| | | return R.data(pwdSendService.getCBCMacEncipher(message)); |
| | | } |
| | | |
| | | @Override |
| | | public R<CBCResultDTO> getCBCMacEncipherVerify(String sm4Iv, String keyIndex, String message) { |
| | | return R.data(pwdSendService.getCBCMacEncipher(sm4Iv, keyIndex, message)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public R<ResultDTO> getDecrypt(String sm4Iv, String keyIndex, String message) { |
| | | return R.data(pwdSendService.getDecrypt(sm4Iv,keyIndex,message)); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(VERIFY) |
| | | public R verify(String maced, String sm4Iv, String keyIndex, String message, String dataId, String source) { |
| | | return R.data(verifyOutputService.verifyMaced(maced,sm4Iv,keyIndex,dataId,source,message)); |
| | | } |
| | | } |