secloud

package
v0.2.0 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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextAccessToken = "accessToken"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOpts

type AuthOpts struct {
	ClientId     optional.String
	ClientSecret optional.String
}

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 AuthRespData struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

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)

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
	KmsExtApi *KmsExtService
}

func NewAPIClient

func NewAPIClient(config *ClientConfig) *Client

type ClientConfig added in v0.1.9

type ClientConfig struct {
	ServerUrl string
}

func NewConfiguration

func NewConfiguration(url string) *ClientConfig

type DecryptOpts added in v0.1.3

type DecryptOpts struct {
	EncData optional.String
}

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 EncryptOpts added in v0.1.3

type EncryptOpts struct {
	KeyId optional.String
	Data  optional.String
}

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 GenerateKeyPairOpts

type GenerateKeyPairOpts struct {
}

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 GenerateKeyPairWithKEKOpts added in v0.1.3

type GenerateKeyPairWithKEKOpts struct {
	KekIndex optional.Int
}

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 GenerateWorkingKeyOpts

type GenerateWorkingKeyOpts struct {
}

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 ImportKeyPairWithKEKOpts added in v0.1.3

type ImportKeyPairWithKEKOpts struct {
	DeviceUrl optional.String
	IpxIndex  optional.Int
	KekIndex  optional.Int
	EncPkey   optional.String
	EncSkey   optional.String
	SignPkey  optional.String
	SignSkey  optional.String
}

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 KmsExtService added in v0.2.0

type KmsExtService struct {
	Base *BaseService
}

func NewKmsExtService added in v0.2.0

func NewKmsExtService() *KmsExtService

func (*KmsExtService) GenerateKeyPairWithKEK added in v0.2.0

func (*KmsExtService) ImportKeyPairWithKEK added in v0.2.0

func (kes *KmsExtService) ImportKeyPairWithKEK(ctx context.Context, opts *ImportKeyPairWithKEKOpts) (*ImportKeyPairWithKEKRespData, error)

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(ctx context.Context, opts *GenerateKeyPairOpts) (*GenerateKeyPairRespData, error)

func (*KmsService) GenerateWorkingKey added in v0.1.8

func (ks *KmsService) GenerateWorkingKey(ctx context.Context, opts *GenerateWorkingKeyOpts) (*GenerateWorkingKeyRespData, error)

type RandomOpts added in v0.1.5

type RandomOpts struct {
	Len optional.Int
}

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

Jump to

Keyboard shortcuts

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