Documentation ¶
Index ¶
- Constants
- func Bind(registry services.IMicroRegistry, opts ...ConfOption) error
- func Config(opts ...Option)
- func NewSasClient(euid string, opts ...ClientOption) *sasClient
- func Unbind()
- type ClientOption
- func WithChain(chain string) ClientOption
- func WithDynamicKeyName(name string) ClientOption
- func WithEncryptName(name ...string) ClientOption
- func WithKeyValue(keyValue string) ClientOption
- func WithSecretName(sertName, sertKeyValue string) ClientOption
- func WithSertModeHead(chain ...string) ClientOption
- func WithSertModeTail(chain ...string) ClientOption
- func WithSertModeTailAndHead(chain ...string) ClientOption
- func WithSignAlias(name string) ClientOption
- func WithSortAll() ClientOption
- func WithSortData() ClientOption
- func WithSortStatic(fields ...string) ClientOption
- func WithTimestampAlias(name string) ClientOption
- func WithUIDAlias(name string) ClientOption
- type ConfOption
- type Option
- type Response
- type SecretOption
- func WithAesSecret(key string) SecretOption
- func WithCertKey(key string) SecretOption
- func WithDesSecret(key string) SecretOption
- func WithExpire(expireSeconds int) SecretOption
- func WithHmacSecret(key string) SecretOption
- func WithMd5Secret(key string) SecretOption
- func WithMerchantCert(key string) SecretOption
- func WithPkcsType(pkcsType string) SecretOption
- func WithRootCert(key string) SecretOption
- func WithRsaBits(rsaBits int) SecretOption
- func WithRsaPrivateKey(priKey string) SecretOption
- func WithRsaPublicKey(pubKey string) SecretOption
- func WithSha1Secret(key string) SecretOption
- func WithSha256Secret(key string) SecretOption
- func WithSha512Secret(key string) SecretOption
- func WithSupplierCert(key string) SecretOption
Constants ¶
View Source
const ( MD5Str = enum.MD5Str SHA1Str = enum.SHA1Str SHA256Str = enum.SHA256Str SHA512Str = enum.SHA512Str HMACStr = enum.HMACStr RSAStr = enum.RSAStr AESStr = enum.AESStr DESStr = enum.DESStr CertStr = enum.CertStr )
加密类型枚举值
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
func Bind(registry services.IMicroRegistry, opts ...ConfOption) error
Bind 将SSO服务注册到应用服务器
func NewSasClient ¶
func NewSasClient(euid string, opts ...ClientOption) *sasClient
NewSasClient 初始化sas请求对象
Types ¶
type ClientOption ¶
type ClientOption func(*sasClient)
ConfOption 配置选项
func WithDynamicKeyName ¶
func WithDynamicKeyName(name string) ClientOption
WithDynamicKeyName 设置动态密钥字段名
func WithSecretName ¶
func WithSecretName(sertName, sertKeyValue string) ClientOption
WithSecretName 设置密钥键名(默认为空) 字段排序方式为:all,密钥也需要加入原串排序时,必须设置密钥key名称;如果不设置,默认:secert
func WithSertModeHead ¶
func WithSertModeHead(chain ...string) ClientOption
WithSertModeHead 设置密钥头部拼接方式 并且用chain链接
func WithSertModeTail ¶
func WithSertModeTail(chain ...string) ClientOption
WithSertModeTail 设置密钥尾部拼接方式 并且用chain链接
func WithSertModeTailAndHead ¶
func WithSertModeTailAndHead(chain ...string) ClientOption
WithSertModeTailNadHead 设置密钥头尾部拼接方式 并且用chain链接
func WithSortAll ¶
func WithSortAll() ClientOption
WithSortAll 设置参数排序方式 排序方式 all-密钥和数据都要参与排序,必须设置密钥key名称;
func WithSortStatic ¶
func WithSortStatic(fields ...string) ClientOption
WithSortStatic 设置参数排序方式 排序方式 static--指定字段参与排序
func WithTimestampAlias ¶
func WithTimestampAlias(name string) ClientOption
WithTimestampAlias 设置timestamp的字段名
type ConfOption ¶
type ConfOption func()
ConfOption 配置选项
func WithDBName ¶
func WithDBName(db string) ConfOption
type Response ¶
type Response struct { UID string `json:"uid"` AesSecret string `json:"aes_secret,omitempty"` DesSecret string `json:"des_secret,omitempty"` HmacSecret string `json:"hmac_secret,omitempty"` Md5Secret string `json:"md5_secret,omitempty"` Sha1Secret string `json:"sha1_secret,omitempty"` Sha256Secret string `json:"sha256_secret,omitempty"` Sha512Secret string `json:"sha512_secret,omitempty"` RsaPrivateSecret string `json:"rsa_private_secret,omitempty"` RsaPublicSecret string `json:"rsa_public_secret,omitempty"` PkcsType string `json:"pkcs_type,omitempty"` Bits int `json:"bits,omitempty"` MerchantCert string `json:"mer_cert,omitempty"` SupplierCert string `json:"spl_cert,omitempty"` RootCert string `json:"root_cert,omitempty"` CertKey string `json:"cert_key,omitempty"` Status string `json:"status"` Time string `json:"time"` ExpireTime string `json:"expire_time"` }
SecretResponse 返回信息
type SecretOption ¶
SecretOption 密码选项
func WithPkcsType ¶
func WithPkcsType(pkcsType string) SecretOption
WithPkcsType 编码方式 pkcs1,pkcs7,pkcs8
func WithSha256Secret ¶
func WithSha256Secret(key string) SecretOption
WithSha256Secret Sha256Secret
func WithSha512Secret ¶
func WithSha512Secret(key string) SecretOption
WithSha512Secret Sha512Secret
func WithSupplierCert ¶
func WithSupplierCert(key string) SecretOption
WithSupplierCert SupplierCert
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
modules
|
|
const/models
* @Description: * @Autor: liujinyin * @Date: 2021-07-02 18:17:24 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:40:42
|
* @Description: * @Autor: liujinyin * @Date: 2021-07-02 18:17:24 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:40:42 |
const/sqls
* @Description: * @Autor: liujinyin * @Date: 2021-07-02 17:28:46 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 18:29:12
|
* @Description: * @Autor: liujinyin * @Date: 2021-07-02 17:28:46 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 18:29:12 |
secret
* @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:58:33
|
* @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:58:33 |
services
|
|
cipher
* @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:07:56 * @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 18:59:24 * @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:00:04
|
* @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:07:56 * @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 18:59:24 * @Description: * @Autor: liujinyin * @Date: 2021-06-28 18:40:43 * @LastEditors: liujinyin * @LastEditTime: 2021-07-02 19:00:04 |
Click to show internal directories.
Click to hide internal directories.