secloud

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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(appKey string, appSecret string) (string, error)

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(token string, data string) (*DecryptRespData, error)

func (*CipherService) Encrypt added in v0.1.8

func (cs *CipherService) Encrypt(token string, keyId string, data string) (*EncryptRespData, error)

func (*CipherService) Random added in v0.1.8

func (cs *CipherService) Random(token string, len int) (*RandomRespData, error)

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 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 GenerateKeyPairResp added in v0.1.8

type GenerateKeyPairResp struct {
	Code int                      `json:"code"`
	Msg  string                   `json:"msg"`
	Data *GenerateKeyPairRespData `json:"data"`
}

type GenerateKeyPairRespData

type GenerateKeyPairRespData struct {
	Pkey string `json:"pkey"`
	Skey string `json:"skey"`
}

type GenerateKeyPairWithKEKResp added in v0.1.8

type GenerateKeyPairWithKEKResp struct {
	Code int                             `json:"code"`
	Msg  string                          `json:"msg"`
	Data *GenerateKeyPairWithKEKRespData `json:"data"`
}

type GenerateKeyPairWithKEKRespData added in v0.1.3

type GenerateKeyPairWithKEKRespData struct {
	IpxIndex int    `json:"ipx_index"`
	EncPkey  string `json:"enc_pkey"`
	EncSkey  string `json:"enc_skey"`
	SignPkey string `json:"sign_pkey"`
	SignSkey string `json:"sign_skey"`
}

type GenerateWorkingKeyResp added in v0.1.8

type GenerateWorkingKeyResp struct {
	Code int                         `json:"code"`
	Msg  string                      `json:"msg"`
	Data *GenerateWorkingKeyRespData `json:"data"`
}

type GenerateWorkingKeyRespData

type GenerateWorkingKeyRespData struct {
	Code   string `json:"code"`
	EncKey string `json:"enc_key"`
}

type ImportKeyPairWithKEKArgs added in v0.1.8

type ImportKeyPairWithKEKArgs struct {
	DeviceUrl string `json:"deviceUrl"`
	IpxIndex  int    `json:"ipxIndex"`
	KekIndex  int    `json:"kekIndex"`
	EncPkey   string `json:"encPkey"`
	EncSkey   string `json:"encSkey"`
	SignPkey  string `json:"signPkey"`
	SignSkey  string `json:"signSkey"`
}

type ImportKeyPairWithKEKResp added in v0.1.8

type ImportKeyPairWithKEKResp struct {
	Code int                           `json:"code"`
	Msg  string                        `json:"msg"`
	Data *ImportKeyPairWithKEKRespData `json:"data"`
}

type ImportKeyPairWithKEKRespData added in v0.1.3

type ImportKeyPairWithKEKRespData struct {
	ID int `json:"id"`
}

type KmsService added in v0.1.8

type KmsService struct {
	Base *BaseService
}

func NewKmsService added in v0.1.8

func NewKmsService() *KmsService

func (*KmsService) GenerateKeyPair added in v0.1.8

func (ks *KmsService) GenerateKeyPair(token string) (*GenerateKeyPairRespData, error)

func (*KmsService) GenerateKeyPairWithKEK added in v0.1.8

func (ks *KmsService) GenerateKeyPairWithKEK(token string, kekIndex int) (*GenerateKeyPairWithKEKRespData, error)

func (*KmsService) GenerateWorkingKey added in v0.1.8

func (ks *KmsService) GenerateWorkingKey(token string) (*GenerateWorkingKeyRespData, error)

func (*KmsService) ImportKeyPairWithKEK added in v0.1.8

func (ks *KmsService) ImportKeyPairWithKEK(token string, args *ImportKeyPairWithKEKArgs) (*ImportKeyPairWithKEKRespData, error)

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"`
}

type SecClient added in v0.1.8

type SecClient struct {
	Config    *SecClientConfig
	AuthApi   *AuthService
	CipherApi *CipherService
	KmsApi    *KmsService
}

func NewSecClient added in v0.1.8

func NewSecClient(config *SecClientConfig) *SecClient

type SecClientConfig added in v0.1.8

type SecClientConfig struct {
	ServerUrl string
}

type TokenResp added in v0.1.8

type TokenResp struct {
	Code int           `json:"code"`
	Msg  string        `json:"msg"`
	Data TokenRespData `json:"data"`
}

type TokenRespData added in v0.1.8

type TokenRespData struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL