Vault | Golang SDK
Asymmetric generate
func (v *vault) AsymmetricGenerate(ctx context.Context, input *AsymmetricGenerateRequest) (*pangea.PangeaResponse[AsymmetricGenerateResult], error)Generate an asymmetric key.
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.
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.
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.
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).
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.
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.
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.
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).
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.
// 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.
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.
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.
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.
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).
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.
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.
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.
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
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.
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
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.
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.
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.
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.
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.
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.
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 stringtype AsymmetricAlgorithm string
Type AsymmetricGenerateRequest
type AsymmetricGenerateRequest structtype 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 structtype AsymmetricGenerateResult struct {
CommonGenerateResult
PublicKey EncodedPublicKey `json:"public_key"`
Algorithm string `json:"algorithm"`
Purpose string `json:"purpose"`
}
Type AsymmetricStoreRequest
type AsymmetricStoreRequest structtype 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 structtype AsymmetricStoreResult struct {
CommonStoreResult
PublicKey EncodedPublicKey `json:"public_key"`
Algorithm string `json:"algorithm"`
Purpose string `json:"purpose"`
}
Type Client
type Client interfacetype 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 structtype 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 structtype CommonGenerateResult struct {
ID string `json:"id"`
Type string `json:"type"`
Version int `json:"version"`
}
Type CommonRotateRequest
type CommonRotateRequest structtype 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 structtype CommonRotateResult struct {
ID string `json:"id"`
Version int `json:"version"`
Type string `json:"type"`
}
Type CommonStoreRequest
type CommonStoreRequest structtype 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 structtype CommonStoreResult struct {
ID string `json:"id"`
Type string `json:"type"`
Version int `json:"version"`
}
Type DecryptRequest
type DecryptRequest structtype 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 structtype DecryptResult struct {
ID string `json:"id"`
Version int `json:"version"`
Algorithm string `json:"algorithm"`
PlainText string `json:"plain_text"`
}
Type DecryptTransformRequest
type DecryptTransformRequest structParameters for a decrypt transform request.
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 structResult of a decrypt transform request.