Documentation ¶
Index ¶
- Constants
- type AuthOpts
- type AuthResp
- type AuthRespData
- type AuthService
- type BaseService
- type CipherService
- type Client
- type ClientConfig
- type DecryptOpts
- type DecryptResp
- type DecryptRespData
- type DestroyKeyOpts
- type DestroyKeyResp
- type DestroyKeyRespData
- type EncryptOpts
- type EncryptResp
- type EncryptRespData
- type ExportPublicKeyOpts
- type ExportPublicKeyResp
- type ExportPublicKeyRespData
- type GenerateKeyOpts
- type GenerateKeyPairOpts
- type GenerateKeyPairResp
- type GenerateKeyPairRespData
- type GenerateKeyResp
- type GenerateKeyRespData
- type ImportKEKOpts
- type ImportKEKResp
- type ImportKEKRespData
- type ImportKeyOpts
- type ImportKeyPairOpts
- type ImportKeyPairResp
- type ImportKeyPairRespData
- type ImportKeyResp
- type ImportKeyRespData
- type KmsService
- func (ks *KmsService) DestroyKey(ctx context.Context, opts *DestroyKeyOpts) (*DestroyKeyRespData, error)
- func (ks *KmsService) ExportPublicKey(ctx context.Context, opts *ExportPublicKeyOpts) (*ExportPublicKeyRespData, error)
- func (ks *KmsService) GenerateKey(ctx context.Context, opts *GenerateKeyOpts) (*GenerateKeyRespData, error)
- func (ks *KmsService) GenerateKeyPair(ctx context.Context, opts *GenerateKeyPairOpts) (*GenerateKeyPairRespData, error)
- func (ks *KmsService) ImportKEK(ctx context.Context, opts *ImportKEKOpts) (*ImportKEKRespData, error)
- func (ks *KmsService) ImportKey(ctx context.Context, opts *ImportKeyOpts) (*ImportKeyRespData, error)
- func (ks *KmsService) ImportKeyPair(ctx context.Context, opts *ImportKeyPairOpts) (*ImportKeyPairRespData, error)
- type RandomOpts
- type RandomResp
- type RandomRespData
Constants ¶
View Source
const (
ContextAccessToken = "accessToken"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResp ¶ added in v0.1.9
type AuthResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *AuthRespData `json:"data"` }
type AuthRespData ¶
type AuthService ¶ added in v0.1.8
type AuthService struct {
Base *BaseService
}
func NewAuthService ¶ added in v0.1.8
func NewAuthService() *AuthService
func (*AuthService) Token ¶ added in v0.1.8
func (as *AuthService) Token(ctx context.Context, authOpts *AuthOpts) (*AuthRespData, error)
Token this func returns auth data, including accessToken and expires deadline
type BaseService ¶ added in v0.1.8
type BaseService struct {
C *resty.Client
}
var BaseSvc *BaseService
type CipherService ¶ added in v0.1.8
type CipherService struct {
Base *BaseService
}
func NewCipherService ¶ added in v0.1.8
func NewCipherService() *CipherService
func (*CipherService) Decrypt ¶ added in v0.1.8
func (cs *CipherService) Decrypt(ctx context.Context, opts *DecryptOpts) (*DecryptRespData, error)
func (*CipherService) Encrypt ¶ added in v0.1.8
func (cs *CipherService) Encrypt(ctx context.Context, opts *EncryptOpts) (*EncryptRespData, error)
func (*CipherService) Random ¶ added in v0.1.8
func (cs *CipherService) Random(ctx context.Context, opts *RandomOpts) (*RandomRespData, error)
type Client ¶ added in v0.1.9
type Client struct { Config *ClientConfig AuthApi *AuthService CipherApi *CipherService KmsApi *KmsService }
func NewAPIClient ¶
func NewAPIClient(config *ClientConfig) *Client
NewAPIClient returns a client to call apis, ClientConfig contains ServerUrl
type ClientConfig ¶ added in v0.1.9
type ClientConfig struct {
ServerUrl string
}
func NewConfiguration ¶
func NewConfiguration(url string) *ClientConfig
NewConfiguration returns a config that contains ServerUrl
type DecryptOpts ¶ added in v0.1.3
type DecryptResp ¶ added in v0.1.8
type DecryptResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *DecryptRespData `json:"data"` }
type DecryptRespData ¶ added in v0.1.3
type DecryptRespData struct {
Data string `json:"data"`
}
type DestroyKeyOpts ¶ added in v0.2.2
type DestroyKeyResp ¶ added in v0.2.2
type DestroyKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *DestroyKeyRespData `json:"data"` }
type DestroyKeyRespData ¶ added in v0.2.2
type DestroyKeyRespData struct {
Result int `json:"result"`
}
type EncryptOpts ¶ added in v0.1.3
type EncryptResp ¶ added in v0.1.8
type EncryptResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *EncryptRespData `json:"data"` }
type EncryptRespData ¶ added in v0.1.3
type EncryptRespData struct {
EncData string `json:"enc_data"`
}
type ExportPublicKeyOpts ¶ added in v0.2.2
type ExportPublicKeyResp ¶ added in v0.2.2
type ExportPublicKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ExportPublicKeyRespData `json:"data"` }
type ExportPublicKeyRespData ¶ added in v0.2.2
type ExportPublicKeyRespData struct {
Pkey string `json:"pkey"`
}
type GenerateKeyOpts ¶ added in v0.2.2
type GenerateKeyOpts struct { GenKeyType optional.String `json:"genKeyType"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` KeyType optional.String `json:"keyType"` Mode optional.String `json:"mode"` PoolId optional.Int64 `json:"poolId"` PublicKey optional.String `json:"publicKey"` }
type GenerateKeyPairOpts ¶
type GenerateKeyPairOpts struct { ExportType optional.String `json:"exportType"` GenKeyType optional.String `json:"genKeyType"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` KeyType optional.String `json:"keyType"` Mode optional.String `json:"mode"` PoolId optional.Int64 `json:"poolId"` PublicKey optional.String `json:"publicKey"` }
type GenerateKeyPairResp ¶ added in v0.1.8
type GenerateKeyPairResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateKeyPairRespData `json:"data"` }
type GenerateKeyPairRespData ¶
type GenerateKeyResp ¶ added in v0.2.2
type GenerateKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateKeyRespData `json:"data"` }
type GenerateKeyRespData ¶ added in v0.2.2
type GenerateKeyRespData struct {
EncKey string `json:"enc_key"`
}
type ImportKEKOpts ¶ added in v0.2.3
type ImportKEKOpts struct { EncKey optional.String `json:"encKey"` PoolId optional.Int64 `json:"poolId"` Mode optional.String `json:"mode"` KeyType optional.String `json:"keyType"` KeyCode optional.String `json:"keyCode"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` TargetIndex optional.Int `json:"targetIndex"` }
type ImportKEKResp ¶ added in v0.2.3
type ImportKEKResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKEKRespData `json:"data"` }
type ImportKEKRespData ¶ added in v0.2.3
type ImportKEKRespData struct {
Index int `json:"index"`
}
type ImportKeyOpts ¶ added in v0.2.2
type ImportKeyOpts struct { EncKey optional.String `json:"encKey"` PoolId optional.Int64 `json:"poolId"` Mode optional.String `json:"mode"` KeyType optional.String `json:"keyType"` KeyCode optional.String `json:"keyCode"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` }
type ImportKeyPairOpts ¶ added in v0.2.2
type ImportKeyPairOpts struct { PoolId optional.Int64 `json:"poolId"` Mode optional.String `json:"mode"` KeyType optional.String `json:"keyType"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` TargetType optional.String `json:"targetType"` TargetIndex optional.Int `json:"targetIndex"` SignPkey optional.String `json:"signPkey"` SignSkey optional.String `json:"signSkey"` EncPkey optional.String `json:"encPkey"` EncSkey optional.String `json:"encSkey"` }
type ImportKeyPairResp ¶ added in v0.2.2
type ImportKeyPairResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKeyPairRespData `json:"data"` }
type ImportKeyPairRespData ¶ added in v0.2.2
type ImportKeyPairRespData struct {
ID int `json:"id"`
}
type ImportKeyResp ¶ added in v0.2.2
type ImportKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKeyRespData `json:"data"` }
type ImportKeyRespData ¶ added in v0.2.2
type ImportKeyRespData struct {
Handle string `json:"handle"`
}
type KmsService ¶ added in v0.1.8
type KmsService struct {
Base *BaseService
}
func NewKmsService ¶ added in v0.1.8
func NewKmsService() *KmsService
func (*KmsService) DestroyKey ¶ added in v0.2.2
func (ks *KmsService) DestroyKey(ctx context.Context, opts *DestroyKeyOpts) (*DestroyKeyRespData, error)
func (*KmsService) ExportPublicKey ¶ added in v0.2.2
func (ks *KmsService) ExportPublicKey(ctx context.Context, opts *ExportPublicKeyOpts) (*ExportPublicKeyRespData, error)
func (*KmsService) GenerateKey ¶ added in v0.2.2
func (ks *KmsService) GenerateKey(ctx context.Context, opts *GenerateKeyOpts) (*GenerateKeyRespData, error)
func (*KmsService) GenerateKeyPair ¶ added in v0.1.8
func (ks *KmsService) GenerateKeyPair(ctx context.Context, opts *GenerateKeyPairOpts) (*GenerateKeyPairRespData, error)
func (*KmsService) ImportKEK ¶ added in v0.2.3
func (ks *KmsService) ImportKEK(ctx context.Context, opts *ImportKEKOpts) (*ImportKEKRespData, error)
func (*KmsService) ImportKey ¶ added in v0.2.2
func (ks *KmsService) ImportKey(ctx context.Context, opts *ImportKeyOpts) (*ImportKeyRespData, error)
func (*KmsService) ImportKeyPair ¶ added in v0.2.2
func (ks *KmsService) ImportKeyPair(ctx context.Context, opts *ImportKeyPairOpts) (*ImportKeyPairRespData, error)
type RandomOpts ¶ added in v0.1.5
type RandomResp ¶ added in v0.1.8
type RandomResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *RandomRespData `json:"data"` }
type RandomRespData ¶ added in v0.1.5
type RandomRespData struct {
Data string `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.