IGmSignFacade.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.dragoninfo.dcuc.duceap.facade;
  2. import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
  3. import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
  4. import org.springframework.cloud.openfeign.FeignClient;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. /**
  8. * 表码数据使用国密算法加密
  9. *
  10. * @author mazq
  11. * @date 2021/5/11
  12. */
  13. @FeignClient(name = "${duceap.service.name:dcuc-duceap}", path = "/duceapsvr/v2/gmSignFacade")
  14. public interface IGmSignFacade {
  15. /**
  16. * 根据codeId校验数据是否符合国密要求
  17. *
  18. * @param codeId
  19. * @return
  20. */
  21. @GetMapping(value = "codeGmCheck")
  22. ResponseStatus codeGmCheck(@RequestParam("codeId") String codeId);
  23. /**
  24. * 根据codeIds校验数据是否符合国密要求
  25. *
  26. * @param codeIds 多个codeId ‘,’隔开
  27. * @return
  28. */
  29. @GetMapping(value = "codeGmCheckCodes")
  30. ResponseStatus codeGmCheckCodes(@RequestParam("codeIds") String codeIds);
  31. /**
  32. * 对codeId的表码数据进行摘要和加密
  33. *
  34. * @param codeId
  35. * @return
  36. */
  37. @GetMapping(value = "codeGmSign")
  38. ResponseStatus codeGmSign(@RequestParam("codeId") String codeId);
  39. /**
  40. * 国密不可否认性校验
  41. *
  42. * @param origin 原文
  43. * @param sign 签名数据
  44. * @return
  45. */
  46. @GetMapping(value = "sm2Verify")
  47. ResponseStatus gmSm2Verify(@RequestParam("origin") String origin, @RequestParam("sign") String sign);
  48. /**
  49. * 国密完整性校验
  50. *
  51. * @param origin 原文
  52. * @param digest 摘要数据
  53. * @return
  54. */
  55. @GetMapping(value = "gmSm3Verify")
  56. ResponseStatus gmSm3Verify(@RequestParam("origin") String origin, @RequestParam("digest") String digest);
  57. /**
  58. * 国密机密性接口解密
  59. *
  60. * @param encode 加密数据
  61. * @return
  62. */
  63. @GetMapping(value = "gmSm4Decode")
  64. ResponseDTO<String> gmSm4Decode(@RequestParam("encode") String encode);
  65. /**
  66. * 国密机密性接口解密
  67. *
  68. * @param origin 原文数据
  69. * @return
  70. */
  71. @GetMapping(value = "gmSm4Encode")
  72. ResponseDTO<String> gmSm4Encode(@RequestParam("origin") String origin);
  73. /**
  74. * 生成SM2签名
  75. *
  76. * @param origin 原文
  77. * @return 签名
  78. */
  79. @GetMapping(value = "gmSm2Sign")
  80. ResponseDTO<String> gmSm2Sign(@RequestParam("origin") String origin);
  81. /**
  82. * 生成SM3摘要
  83. *
  84. * @param origin 原文
  85. * @return 摘要
  86. */
  87. @GetMapping(value = "gmSm3Digest")
  88. ResponseDTO<String> gmSm3Digest(@RequestParam("origin") String origin);
  89. }