Skip to main content

Vault | Golang SDK

Asymmetric generate

func (v *vault) AsymmetricGenerate(ctx context.Context, input *AsymmetricGenerateRequest) (*pangea.PangeaResponse[AsymmetricGenerateResult], error)

Generate an asymmetric key.

required parameters

context.Context
input := &vault.AsymmetricGenerateRequest{
	Algorithm: vault.AArsa2048_pkcs1v15_sha256,
	Purpose:   vault.KPsigning,
	CommonGenerateRequest: vault.CommonGenerateRequest{
		Name:   pangea.StringValue("my-very-secret-secret"),
		Folder: pangea.StringValue("/personal"),
		Metadata: vault.Metadata{
			"created_by": pangea.StringValue("John Doe"),
			"used_in":    pangea.StringValue("Google products"),
		},
		Tags: vault.Tags{
			pangea.StringValue("irs_2023"),
			pangea.StringValue("personal"),
		},
		RotationFrequency: pangea.StringValue("10d"),
		RotationState:     pangea.StringValue("deactivated"),
		Expiration:        pangea.StringValue("2025-01-01T10:00:00Z"),
	},
}

agr, err := vaultcli.AsymmetricGenerate(ctx, input)

Asymmetric store

func (v *vault) AsymmetricStore(ctx context.Context, input *AsymmetricStoreRequest) (*pangea.PangeaResponse[AsymmetricStoreResult], error)

Import an asymmetric key.

required parameters

context.Context
var PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA8s5JopbEPGBylPBcMK+L5PqHMqPJW/5KYPgBHzZGncc=\n-----END PUBLIC KEY-----"
var PRIVATE_KEY = "private key example"

input := &vault.AsymmetricStoreRequest{
	Algorithm:  vault.AArsa2048_pkcs1v15_sha256,
	PublicKey:  vault.EncodedPublicKey(PUBLIC_KEY),
	PrivateKey: vault.EncodedPrivateKey(PRIVATE_KEY),
	Purpose:    vault.KPsigning,
	CommonStoreRequest: vault.CommonStoreRequest{
		Name: pangea.StringValue("my-very-secret-secret"),
		Folder: pangea.StringValue("/personal"),
		Metadata: vault.Metadata{
			"created_by": pangea.StringValue("John Doe"),
			"used_in":    pangea.StringValue("Google products"),
		},
		Tags: vault.Tags{
			pangea.StringValue("irs_2023"),
			pangea.StringValue("personal"),
		},
		RotationFrequency: pangea.StringValue("10d"),
		RotationState:     pangea.StringValue("deactivated"),
		Expiration:        pangea.StringValue("2025-01-01T10:00:00Z"),
	},
}

asr, err := vaultcli.AsymmetricStore(ctx, input)

Decrypt

func (v *vault) Decrypt(ctx context.Context, input *DecryptRequest) (*pangea.PangeaResponse[DecryptResult], error)

Decrypt a message using a key.

required parameters

context.Context
input := &vault.DecryptRequest{
	ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	CipherText: pangea.StringValue("lJkk0gCLux+Q+rPNqLPEYw=="),
	Version: pangea.Int(1),
}

dr, err := vaultcli.Decrypt(ctx, input)

Decrypt structured

func (v *vault) DecryptStructured(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

Decrypt parts of a JSON object.

required parameters

context.Context
data := map[string]interface{}{
	"field1": [4]interface{}{1, 2, "kxcbC9E9IlgVaSCChPWUMgUC3ko=", "6FfI/LCzatLRLNAc8SuBK/TDnGxp"},
	"field2": "true",
}

decryptedResponse, err := client.DecryptStructured(
	ctx,
	&vault.EncryptStructuredRequest{
		ID:             "pvi_[...]",
		StructuredData: data,
		Filter:         "$.field1[2:4]",
	},
)

Decrypt transform

func (v *vault) DecryptTransform(ctx context.Context, input *DecryptTransformRequest) (*pangea.PangeaResponse[DecryptTransformResult], error)

Decrypt using a format-preserving algorithm (FPE).

required parameters

context.Context
decryptedResponse, err := client.DecryptTransform(
	ctx,
	&vault.DecryptTransformRequest{
		ID:         "pvi_[...]",
		CipherText: "tZB-UKVP-MzTM",
		Tweak:      "MTIzMTIzMT==",
		Alphabet:   vault.TAalphanumeric,
	},
)

Delete

func (v *vault) Delete(ctx context.Context, input *DeleteRequest) (*pangea.PangeaResponse[DeleteResult], error)

Delete a secret or key.

required parameters

context.Context
input := &vault.DeleteRequest{
	ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
}

dr, err := vaultcli.Delete(ctx, input)

Encrypt

func (v *vault) Encrypt(ctx context.Context, input *EncryptRequest) (*pangea.PangeaResponse[EncryptResult], error)

Encrypt a message using a key.

required parameters

context.Context
msg := "message to encrypt..."
data := base64.StdEncoding.EncodeToString([]byte(msg))

input := &vault.EncryptRequest{
	ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	PlainText: data,
	Version: pangea.Int(1),
}

enc, err := vaultcli.Encrypt(ctx, input)

Encrypt structured

func (v *vault) EncryptStructured(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

Encrypt parts of a JSON object.

required parameters

context.Context
data := map[string]interface{}{
	"field1": [4]interface{}{1, 2, "true", "false"},
	"field2": "true",
}

encryptedResponse, err := client.EncryptStructured(
	ctx,
	&vault.EncryptStructuredRequest{
		ID:             "pvi_[...]",
		StructuredData: data,
		Filter:         "$.field1[2:4]",
	},
)

Encrypt transform

func (v *vault) EncryptTransform(ctx context.Context, input *EncryptTransformRequest) (*pangea.PangeaResponse[EncryptTransformResult], error)

Encrypt using a format-preserving algorithm (FPE).

required parameters

context.Context
encryptedResponse, err := client.EncryptTransform(
	ctx,
	&vault.EncryptTransformRequest{
		ID:        "pvi_[...]",
		PlainText: "123-4567-8901",
		Tweak:     "MTIzMTIzMT==",
		Alphabet:  vault.TAalphanumeric,
	},
)

Export

func (v *vault) Export(ctx context.Context, input *ExportRequest) (*pangea.PangeaResponse[ExportResult], error)

Export a symmetric or asymmetric key.

required parameters

context.Context
// Generate an exportable key.
generated, err := client.AsymmetricGenerate(ctx,
	&vault.AsymmetricGenerateRequest{
		CommonGenerateRequest: vault.CommonGenerateRequest{
			Name: "a-name-for-the-key",
		},
		Algorithm:  vault.AAed25519,
		Purpose:    vault.KPsigning,
		Exportable: pangea.Bool(true),
	})

// Then it can be exported whenever needed.
exported, err := client.Export(ctx, &vault.ExportRequest{id: generated.Result.ID})

Create

func (v *vault) FolderCreate(ctx context.Context, input *FolderCreateRequest) (*pangea.PangeaResponse[FolderCreateResult], error)

Creates a folder.

required parameters

context.Context
input := &vault.FolderCreateRequest{
 	Name:   "folder_name",
 	Folder: "parent/folder/name",
}

enc, err := vaultcli.FolderCreate(ctx, input)

Retrieve

func (v *vault) Get(ctx context.Context, input *GetRequest) (*pangea.PangeaResponse[GetResult], error)

Retrieve a secret or key, and any associated information.

required parameters

context.Context
input := &vault.GetRequest{
	ID:           pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	Version:      pangea.StringValue(1),
	Verbose:      pangea.Bool(true),
	VersionState: &vault.IVSactive,
}

gr, err := vaultcli.Get(ctx, input)

JWT Retrieve

func (v *vault) JWKGet(ctx context.Context, input *JWKGetRequest) (*pangea.PangeaResponse[JWKGetResult], error)

Retrieve a key in JWK format.

required parameters

context.Context
input := &vault.JWKGetRequest{
	ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
}

jr, err := vaultcli.JWKGet(ctx, input)

JWT Sign

func (v *vault) JWTSign(ctx context.Context, input *JWTSignRequest) (*pangea.PangeaResponse[JWTSignResult], error)

Sign a JSON Web Token (JWT) using a key.

required parameters

context.Context
input := &vault.JWTSignRequest{
	ID:      pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	Payload: pangea.StringValue("{\"sub\": \"1234567890\",\"name\": \"John Doe\",\"admin\": true}"),
}

jr, err := vaultcli.JWTSign(ctx, input)

JWT Verify

func (v *vault) JWTVerify(ctx context.Context, input *JWTVerifyRequest) (*pangea.PangeaResponse[JWTVerifyResult], error)

Verify the signature of a JSON Web Token (JWT).

required parameters

context.Context
input := &vault.JWTVerifyRequest{
	JWS: pangea.StringValue("ewogICJhbGciO..."),
}

jr, err := vaultcli.JWTVerify(ctx, input)

Key rotate

func (v *vault) KeyRotate(ctx context.Context, input *KeyRotateRequest) (*pangea.PangeaResponse[KeyRotateResult], error)

Manually rotate a symmetric or asymmetric key.

required parameters

context.Context
var SYMMETRIC_KEY = "lJkk0gCLux+Q+rPNqLPEYw=="

input := &vault.KeyRotateRequest{
	CommonRotateRequest: vault.CommonRotateRequest{
		ID:            pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
		RotationState: vault.IVSdeactivated,
	},
	Key: &vault.EncodedSymmetricKey(SYMMETRIC_KEY),
}

krr, err := vaultcli.KeyRotate(ctx, input)

List

func (v *vault) List(ctx context.Context, input *ListRequest) (*pangea.PangeaResponse[ListResult], error)

Retrieve a list of secrets, keys and folders, and their associated information.

required parameters

context.Context
input := &vault.ListRequest{
	Filter: map[string]string{
		"folder": "/",
		"type": "asymmetric_key",
		"name__contains": "test",
		"metadata_key1": "value1",
		"created_at__lt": "2023-12-12T00:00:00Z",
	},
	Last:    pangea.StringValue("WyIvdGVzdF8yMDdfc3ltbWV0cmljLyJd"),
	Size:    pangea.IntValue(20),
	Order:   vault.IOasc,
	OrderBy: vault.IOBname,
}

lr, err := vaultcli.List(ctx, input)

Token rotate

func (v *vault) PangeaTokenRotate(ctx context.Context, input *PangeaTokenRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)

Rotate a Pangea token.

required parameters

context.Context
input := &vault.PangeaTokenRotateRequest{
	RotationGracePeriod: pangea.StringValue("1d"),
	CommonRotateRequest: vault.CommonRotateRequest{
		ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	},
}

trp, err := vaultcli.PangeaTokenRotate(ctx, input)

Pangea token store

func (v *vault) PangeaTokenStore(ctx context.Context, input *PangeaTokenStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)

Import a secret

required parameters

context.Context
input := &vault.PangeaTokenStoreRequest{
	Token: pangea.StringValue("ptv_x6fdiizbon6j3bsdvnpmwxsz2aan7fqd"),
	CommonStoreRequest: vault.CommonStoreRequest{
		Name: pangea.StringValue("my-very-secret-secret"),
		Folder: pangea.StringValue("/personal"),
		Metadata: vault.Metadata{
			"created_by": pangea.StringValue("John Doe"),
			"used_in":    pangea.StringValue("Google products"),
		},
		Tags: vault.Tags{
			pangea.StringValue("irs_2023"),
			pangea.StringValue("personal"),
		},
		RotationFrequency: pangea.StringValue("10d"),
		RotationState:     pangea.StringValue("deactivated"),
		Expiration:        pangea.StringValue("2025-01-01T10:00:00Z"),
	},
}

tsr, err := vaultcli.PangeaTokenStore(ctx, input)

Secret rotate

func (v *vault) SecretRotate(ctx context.Context, input *SecretRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)

Rotate a secret.

required parameters

context.Context
input := &vault.SecretRotateRequest{
	Secret: pangea.StringValue("12sdfgs4543qv@#%$casd"),
	CommonRotateRequest: vault.CommonRotateRequest{
		ID:           pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
		RotationState vault.IVSdeactivated,
	},
}

srr, err := vaultcli.SecretRotate(ctx, input)

Secret store

func (v *vault) SecretStore(ctx context.Context, input *SecretStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)

Import a secret

required parameters

context.Context
input := &vault.SecretStoreRequest{
	Secret: pangea.StringValue("12sdfgs4543qv@#%$casd"),
	CommonStoreRequest: vault.CommonStoreRequest{
		Name: pangea.StringValue("my-very-secret-secret"),
		Folder: pangea.StringValue("/personal"),
		Metadata: vault.Metadata{
			"created_by": pangea.StringValue("John Doe"),
			"used_in":    pangea.StringValue("Google products"),
		},
		Tags: vault.Tags{
			pangea.StringValue("irs_2023"),
			pangea.StringValue("personal"),
		},
		RotationFrequency: pangea.StringValue("10d"),
		RotationState:     pangea.StringValue("deactivated"),
		Expiration:        pangea.StringValue("2025-01-01T10:00:00Z"),
	},
}

ssr, err := vaultcli.SecretStore(ctx, input)

Sign

func (v *vault) Sign(ctx context.Context, input *SignRequest) (*pangea.PangeaResponse[SignResult], error)

Sign a message using a key.

required parameters

context.Context
msg := "message to sign..."
data := base64.StdEncoding.EncodeToString([]byte(msg))

input := &vault.SignRequest{
	ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	Message: data,
	Version: pangea.Int(1),
}

sr, err := vaultcli.Sign(ctx, input)

State change

func (v *vault) StateChange(ctx context.Context, input *StateChangeRequest) (*pangea.PangeaResponse[StateChangeResult], error)

Change the state of a specific version of a secret or key.

required parameters

context.Context
input := &vault.StateChangeRequest{
	ID:    pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	State: vault.IVSdeactivated,
}

scr, err := vaultcli.StateChange(ctx, input)

Symmetric generate

func (v *vault) SymmetricGenerate(ctx context.Context, input *SymmetricGenerateRequest) (*pangea.PangeaResponse[SymmetricGenerateResult], error)

Generate a symmetric key.

required parameters

context.Context
input := &vault.SymmetricGenerateRequest{
	Algorithm: vault.SYAaes128_cfb,
	Purpose:   vault.KPencryption,
	CommonGenerateRequest: vault.CommonGenerateRequest{
		Name:   pangea.StringValue("my-very-secret-secret"),
		Folder: pangea.StringValue("/personal"),
		Metadata: vault.Metadata{
			"created_by": pangea.StringValue("John Doe"),
			"used_in":    pangea.StringValue("Google products"),
		},
		Tags: vault.Tags{
			pangea.StringValue("irs_2023"),
			pangea.StringValue("personal"),
		},
		RotationFrequency: pangea.StringValue("10d"),
		RotationState:     pangea.StringValue("deactivated"),
		Expiration:        pangea.StringValue("2025-01-01T10:00:00Z"),
	},
}

sgr, err := vaultcli.SymmetricGenerate(ctx, input)

Symmetric store

func (v *vault) SymmetricStore(ctx context.Context, input *SymmetricStoreRequest) (*pangea.PangeaResponse[SymmetricStoreResult], error)

Import a symmetric key.

required parameters

context.Context
input := &vault.SymmetricStoreRequest{
	Key: vault.EncodedSymmetricKey("lJkk0gCLux+Q+rPNqLPEYw=="),
	Algorithm: vault.SYAaes128_cfb,
	Purpose: vault.KPencryption,
	CommonStoreRequest: vault.CommonStoreRequest{
		Name: pangea.StringValue("my-very-secret-secret"),
		Folder: pangea.StringValue("/personal"),
		Metadata: vault.Metadata{
			"created_by": pangea.StringValue("John Doe"),
			"used_in":    pangea.StringValue("Google products"),
		},
		Tags: vault.Tags{
			pangea.StringValue("irs_2023"),
			pangea.StringValue("personal"),
		},
		RotationFrequency: pangea.StringValue("10d"),
		RotationState:     pangea.StringValue("deactivated"),
		Expiration:        pangea.StringValue("2025-01-01T10:00:00Z"),
	},
}

ssr, err := vaultcli.SymmetricStore(ctx, input)

Update

func (v *vault) Update(ctx context.Context, input *UpdateRequest) (*pangea.PangeaResponse[UpdateResult], error)

Update information associated with a secret or key.

required parameters

context.Context
input := &vault.Update Request{
	ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	Name: pangea.StringValue("my-very-secret-secret"),
	Folder: pangea.StringValue("/personal"),
	Metadata: vault.Metadata{
		"created_by": pangea.StringValue("John Doe"),
		"used_in":    pangea.StringValue("Google products"),
	},
	Tags: vault.Tags{
		pangea.StringValue("irs_2023"),
		pangea.StringValue("personal"),
	},
	RotationFrequency:   pangea.StringValue("10d"),
	RotationState:       pangea.StringValue("deactivated"),
	RotationGracePeriod: pangea.StringValue("1d"),
	Expiration:          pangea.StringValue("2025-01-01T10:00:00Z"),
	ItemState:           vault.ISdisabled,
}

ur, err := vaultcli.Update(ctx, input)

Verify

func (v *vault) Verify(ctx context.Context, input *VerifyRequest) (*pangea.PangeaResponse[VerifyResult], error)

Verify a signature using a key.

required parameters

context.Context
input := &vault.VerifyRequest{
	ID:        pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
	Version:   pangea.Int(1),
	Message:   pangea.StringValue("lJkk0gCLux+Q+rPNqLPEYw=="),
	Signature: pangea.StringValue("FfWuT2Mq/+cxa7wIugfhzi7ktZxVf926idJNgBDCysF/knY9B7M6wxqHMMPDEBs86D8OsEGuED21y3J7IGOpCQ=="),
}

vr, err := vaultcli.Verify(ctx, input)

Type AsymmetricAlgorithm

type AsymmetricAlgorithm string
type AsymmetricAlgorithm string

Type AsymmetricGenerateRequest

type AsymmetricGenerateRequest struct

required parameters

AsymmetricAlgorithm `json:"algorithm,omitempty"`
*bool `json:"exportable,omitempty"`
type AsymmetricGenerateRequest struct {
	CommonGenerateRequest
	Algorithm	AsymmetricAlgorithm	`json:"algorithm,omitempty"`
	Purpose		KeyPurpose		`json:"purpose,omitempty"`
	Exportable	*bool			`json:"exportable,omitempty"`	// Whether the key is exportable or not.
}

Type AsymmetricGenerateResult

type AsymmetricGenerateResult struct

required parameters

EncodedPublicKey `json:"public_key"`
string `json:"algorithm"`
string `json:"purpose"`
type AsymmetricGenerateResult struct {
	CommonGenerateResult
	PublicKey	EncodedPublicKey	`json:"public_key"`
	Algorithm	string			`json:"algorithm"`
	Purpose		string			`json:"purpose"`
}

Type AsymmetricStoreRequest

type AsymmetricStoreRequest struct

required parameters

AsymmetricAlgorithm `json:"algorithm"`
*bool `json:"exportable,omitempty"`
type AsymmetricStoreRequest struct {
	CommonStoreRequest
	Algorithm	AsymmetricAlgorithm	`json:"algorithm"`
	PublicKey	EncodedPublicKey	`json:"public_key"`
	PrivateKey	EncodedPrivateKey	`json:"private_key"`
	Purpose		KeyPurpose		`json:"purpose,omitempty"`
	Exportable	*bool			`json:"exportable,omitempty"`	// Whether the key is exportable or not.
}

Type AsymmetricStoreResult

type AsymmetricStoreResult struct

required parameters

EncodedPublicKey `json:"public_key"`
string `json:"algorithm"`
string `json:"purpose"`
type AsymmetricStoreResult struct {
	CommonStoreResult
	PublicKey	EncodedPublicKey	`json:"public_key"`
	Algorithm	string			`json:"algorithm"`
	Purpose		string			`json:"purpose"`
}

Type Client

type Client interface

required parameters

func(ctx context.Context, req *StateChangeRequest) (*pangea.PangeaResponse[StateChangeResult], error)
context.Context
func(ctx context.Context, req *DeleteRequest) (*pangea.PangeaResponse[DeleteResult], error)
context.Context
func(ctx context.Context, req *GetRequest) (*pangea.PangeaResponse[GetResult], error)
context.Context
func(ctx context.Context, req *JWKGetRequest) (*pangea.PangeaResponse[JWKGetResult], error)
context.Context
func(ctx context.Context, req *ListRequest) (*pangea.PangeaResponse[ListResult], error)
context.Context
func(ctx context.Context, req *UpdateRequest) (*pangea.PangeaResponse[UpdateResult], error)
context.Context
func(ctx context.Context, req *SecretStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)
context.Context
func(ctx context.Context, req *PangeaTokenStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)
context.Context
func(ctx context.Context, req *SecretRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)
context.Context
func(ctx context.Context, req *PangeaTokenRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)
context.Context
func(ctx context.Context, req *SymmetricGenerateRequest) (*pangea.PangeaResponse[SymmetricGenerateResult], error)
context.Context
func(ctx context.Context, req *AsymmetricGenerateRequest) (*pangea.PangeaResponse[AsymmetricGenerateResult], error)
context.Context
func(ctx context.Context, req *SymmetricStoreRequest) (*pangea.PangeaResponse[SymmetricStoreResult], error)
context.Context
func(ctx context.Context, req *AsymmetricStoreRequest) (*pangea.PangeaResponse[AsymmetricStoreResult], error)
context.Context
func(ctx context.Context, req *KeyRotateRequest) (*pangea.PangeaResponse[KeyRotateResult], error)
context.Context
func(ctx context.Context, req *EncryptRequest) (*pangea.PangeaResponse[EncryptResult], error)
context.Context
func(ctx context.Context, req *DecryptRequest) (*pangea.PangeaResponse[DecryptResult], error)
context.Context
func(ctx context.Context, req *SignRequest) (*pangea.PangeaResponse[SignResult], error)
context.Context
func(ctx context.Context, req *VerifyRequest) (*pangea.PangeaResponse[VerifyResult], error)
context.Context
func(ctx context.Context, req *JWTSignRequest) (*pangea.PangeaResponse[JWTSignResult], error)
context.Context
func(ctx context.Context, req *JWTVerifyRequest) (*pangea.PangeaResponse[JWTVerifyResult], error)
context.Context
func(ctx context.Context, req *FolderCreateRequest) (*pangea.PangeaResponse[FolderCreateResult], error)
context.Context
func(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

Encrypt parts of a JSON object.

context.Context
func(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

Decrypt parts of a JSON object.

context.Context
func(ctx context.Context, input *EncryptTransformRequest) (*pangea.PangeaResponse[EncryptTransformResult], error)

Encrypt using a format-preserving algorithm (FPE).

context.Context
func(ctx context.Context, input *DecryptTransformRequest) (*pangea.PangeaResponse[DecryptTransformResult], error)

Decrypt using a format-preserving algorithm (FPE).

context.Context
func(ctx context.Context, input *ExportRequest) (*pangea.PangeaResponse[ExportResult], error)

Export a symmetric or asymmetric key.

context.Context
pangea.BaseServicer

Base service methods

type Client interface {
	StateChange(ctx context.Context, req *StateChangeRequest) (*pangea.PangeaResponse[StateChangeResult], error)
	Delete(ctx context.Context, req *DeleteRequest) (*pangea.PangeaResponse[DeleteResult], error)
	Get(ctx context.Context, req *GetRequest) (*pangea.PangeaResponse[GetResult], error)
	JWKGet(ctx context.Context, req *JWKGetRequest) (*pangea.PangeaResponse[JWKGetResult], error)
	List(ctx context.Context, req *ListRequest) (*pangea.PangeaResponse[ListResult], error)
	Update(ctx context.Context, req *UpdateRequest) (*pangea.PangeaResponse[UpdateResult], error)
	SecretStore(ctx context.Context, req *SecretStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)
	PangeaTokenStore(ctx context.Context, req *PangeaTokenStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)
	SecretRotate(ctx context.Context, req *SecretRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)
	PangeaTokenRotate(ctx context.Context, req *PangeaTokenRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)
	SymmetricGenerate(ctx context.Context, req *SymmetricGenerateRequest) (*pangea.PangeaResponse[SymmetricGenerateResult], error)
	AsymmetricGenerate(ctx context.Context, req *AsymmetricGenerateRequest) (*pangea.PangeaResponse[AsymmetricGenerateResult], error)
	SymmetricStore(ctx context.Context, req *SymmetricStoreRequest) (*pangea.PangeaResponse[SymmetricStoreResult], error)
	AsymmetricStore(ctx context.Context, req *AsymmetricStoreRequest) (*pangea.PangeaResponse[AsymmetricStoreResult], error)
	KeyRotate(ctx context.Context, req *KeyRotateRequest) (*pangea.PangeaResponse[KeyRotateResult], error)
	Encrypt(ctx context.Context, req *EncryptRequest) (*pangea.PangeaResponse[EncryptResult], error)
	Decrypt(ctx context.Context, req *DecryptRequest) (*pangea.PangeaResponse[DecryptResult], error)
	Sign(ctx context.Context, req *SignRequest) (*pangea.PangeaResponse[SignResult], error)
	Verify(ctx context.Context, req *VerifyRequest) (*pangea.PangeaResponse[VerifyResult], error)
	JWTSign(ctx context.Context, req *JWTSignRequest) (*pangea.PangeaResponse[JWTSignResult], error)
	JWTVerify(ctx context.Context, req *JWTVerifyRequest) (*pangea.PangeaResponse[JWTVerifyResult], error)
	FolderCreate(ctx context.Context, req *FolderCreateRequest) (*pangea.PangeaResponse[FolderCreateResult], error)

	// Encrypt parts of a JSON object.
	EncryptStructured(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

	// Decrypt parts of a JSON object.
	DecryptStructured(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

	// Encrypt using a format-preserving algorithm (FPE).
	EncryptTransform(ctx context.Context, input *EncryptTransformRequest) (*pangea.PangeaResponse[EncryptTransformResult], error)

	// Decrypt using a format-preserving algorithm (FPE).
	DecryptTransform(ctx context.Context, input *DecryptTransformRequest) (*pangea.PangeaResponse[DecryptTransformResult], error)

	// Export a symmetric or asymmetric key.
	Export(ctx context.Context, input *ExportRequest) (*pangea.PangeaResponse[ExportResult], error)

	// Base service methods
	pangea.BaseServicer
}

Type CommonGenerateRequest

type CommonGenerateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"name,omitempty"`
string `json:"folder,omitempty"`
string `json:"rotation_frequency,omitempty"`
string `json:"expiration,omitempty"`
type CommonGenerateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Type			ItemType		`json:"type"`
	Name			string			`json:"name,omitempty"`
	Folder			string			`json:"folder,omitempty"`
	Metadata		Metadata		`json:"metadata,omitempty"`
	Tags			Tags			`json:"tags,omitempty"`
	RotationFrequency	string			`json:"rotation_frequency,omitempty"`
	RotationState		ItemVersionState	`json:"rotation_state,omitempty"`
	Expiration		string			`json:"expiration,omitempty"`
}

Type CommonGenerateResult

type CommonGenerateResult struct

required parameters

string `json:"id"`
string `json:"type"`
int `json:"version"`
type CommonGenerateResult struct {
	ID	string	`json:"id"`
	Type	string	`json:"type"`
	Version	int	`json:"version"`
}

Type CommonRotateRequest

type CommonRotateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"id"`
type CommonRotateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID		string			`json:"id"`
	RotationState	ItemVersionState	`json:"rotation_state,omitempty"`
}

Type CommonRotateResult

type CommonRotateResult struct

required parameters

string `json:"id"`
int `json:"version"`
string `json:"type"`
type CommonRotateResult struct {
	ID	string	`json:"id"`
	Version	int	`json:"version"`
	Type	string	`json:"type"`
}

Type CommonStoreRequest

type CommonStoreRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"name,omitempty"`
string `json:"folder,omitempty"`
string `json:"rotation_frequency,omitempty"`
string `json:"expiration,omitempty"`
type CommonStoreRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Type			ItemType		`json:"type"`
	Name			string			`json:"name,omitempty"`
	Folder			string			`json:"folder,omitempty"`
	Metadata		Metadata		`json:"metadata,omitempty"`
	Tags			Tags			`json:"tags,omitempty"`
	RotationFrequency	string			`json:"rotation_frequency,omitempty"`
	RotationState		ItemVersionState	`json:"rotation_state,omitempty"`
	Expiration		string			`json:"expiration,omitempty"`
}

Type CommonStoreResult

type CommonStoreResult struct

required parameters

string `json:"id"`
string `json:"type"`
int `json:"version"`
type CommonStoreResult struct {
	ID	string	`json:"id"`
	Type	string	`json:"type"`
	Version	int	`json:"version"`
}

Type DecryptRequest

type DecryptRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"id"`
string `json:"cipher_text"`
*int `json:"version,omitempty"`
*string `json:"additional_data,omitempty"`
type DecryptRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID		string	`json:"id"`
	CipherText	string	`json:"cipher_text"`
	Version		*int	`json:"version,omitempty"`
	AdditionalData	*string	`json:"additional_data,omitempty"`
}

Type DecryptResult

type DecryptResult struct

required parameters

string `json:"id"`
int `json:"version"`
string `json:"algorithm"`
string `json:"plain_text"`
type DecryptResult struct {
	ID		string	`json:"id"`
	Version		int	`json:"version"`
	Algorithm	string	`json:"algorithm"`
	PlainText	string	`json:"plain_text"`
}

Type DecryptTransformRequest

type DecryptTransformRequest struct

Parameters for a decrypt transform request.

required parameters

string `json:"id"`

The ID of the key to use.

string `json:"cipher_text"`

A message encrypted by Vault.

string `json:"tweak"`

User provided tweak string. If not provided, a random string will be generated and returned. The user must securely store the tweak source which will be needed to decrypt the data.

Set of characters to use for format-preserving encryption (FPE).

*int `json:"version,omitempty"`

The item version. Defaults to the current version.

type DecryptTransformRequest struct {
	pangea.BaseRequest

	// The ID of the key to use.
	ID	string	`json:"id"`

	// A message encrypted by Vault.
	CipherText	string	`json:"cipher_text"`

	// User provided tweak string. If not provided, a random string will be
	// generated and returned. The user must securely store the tweak source
	// which will be needed to decrypt the data.
	Tweak	string	`json:"tweak"`

	// Set of characters to use for format-preserving encryption (FPE).
	Alphabet	TransformAlphabet	`json:"alphabet"`

	// The item version. Defaults to the current version.
	Version	*int	`json:"version,omitempty"`
}

Type DecryptTransformResult

type DecryptTransformResult struct

Result of a decrypt transform request.

required parameters