1package seal 2 3import ( 4 "context" 5 6 "github.com/hashicorp/vault/sdk/physical" 7) 8 9const ( 10 Shamir = "shamir" 11 PKCS11 = "pkcs11" 12 AliCloudKMS = "alicloudkms" 13 AWSKMS = "awskms" 14 GCPCKMS = "gcpckms" 15 AzureKeyVault = "azurekeyvault" 16 OCIKMS = "ocikms" 17 Transit = "transit" 18 Test = "test-auto" 19 20 // HSMAutoDeprecated is a deprecated seal type prior to 0.9.0. 21 // It is still referenced in certain code paths for upgrade purporses 22 HSMAutoDeprecated = "hsm-auto" 23) 24 25type Encryptor interface { 26 Encrypt(context.Context, []byte) (*physical.EncryptedBlobInfo, error) 27 Decrypt(context.Context, *physical.EncryptedBlobInfo) ([]byte, error) 28} 29 30// Access is the embedded implementation of autoSeal that contains logic 31// specific to encrypting and decrypting data, or in this case keys. 32type Access interface { 33 SealType() string 34 KeyID() string 35 36 Init(context.Context) error 37 Finalize(context.Context) error 38 39 Encryptor 40} 41