Class InterfaceSecurityService

java.lang.Object
cn.herodotus.engine.oauth2.management.service.InterfaceSecurityService

@Service public class InterfaceSecurityService extends Object

Description: 请求加密服务

Author:
: gengwei.zheng
Date:
: 2021/9/30 18:08
  • Constructor Summary

    Constructors
    Constructor
    Description
    InterfaceSecurityService(cn.herodotus.engine.rest.protect.crypto.processor.HttpCryptoProcessor httpCryptoProcessor, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    cn.herodotus.engine.assistant.definition.domain.oauth2.SecretKey
    createSecretKey(String clientId, String clientSecret, String sessionId)
     
    exchange(String sessionId, String confidentialBase64)
    前端用后端PublicKey加密前端PublicKey后,将该值传递给后端,用于加密 AES KEY

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InterfaceSecurityService

      public InterfaceSecurityService(cn.herodotus.engine.rest.protect.crypto.processor.HttpCryptoProcessor httpCryptoProcessor, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository)
  • Method Details

    • createSecretKey

      public cn.herodotus.engine.assistant.definition.domain.oauth2.SecretKey createSecretKey(String clientId, String clientSecret, String sessionId)
    • exchange

      public String exchange(String sessionId, String confidentialBase64)
      前端用后端PublicKey加密前端PublicKey后,将该值传递给后端,用于加密 AES KEY
      Parameters:
      sessionId - Session 标识
      confidentialBase64 - 前端用后端PublicKey加密前端PublicKey。前端使用node-rsa加密后的数据是base64编码
      Returns:
      前端RSA PublicKey 加密后的 AES Key