Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlgorithmSupported ¶
IsAlgorithmSupported returns true if the algorithm is supported for encryption or signature
func VaultUrl ¶ added in v1.3.0
vaultUrl returns the URL for the Azure Key Vault Parameter vault can be one of: - The address of the vault, such as "https://<name>.vault.azure.net" (could be a different format if using different clouds or private endpoints) - The FQDN of the vault, such as "<name>.vault.azure.net" (or another domain if using different clouds or private endpoints) - Only the name of the vault, which will be formatted for "vault.azure.net"
Types ¶
type Client ¶
type Client interface { // Encrypt a message using a key stored in the Key Vault Encrypt(ctx context.Context, vault, keyName, keyVersion string, params azkeys.KeyOperationParameters) (*KeyVaultEncryptResponse, error) // Decrypt a message using a key stored in the Key Vault. Decrypt(ctx context.Context, vault, keyName, keyVersion string, params azkeys.KeyOperationParameters) (*KeyVaultDecryptResponse, error) // WrapKey wraps a key using the key-encryption-key stored in the Key Vault WrapKey(ctx context.Context, vault, keyName, keyVersion string, params azkeys.KeyOperationParameters) (*KeyVaultEncryptResponse, error) // UnwrapKey unwrap a wrapped key using the key-encryption-key stored in the Key Vault UnwrapKey(ctx context.Context, vault, keyName, keyVersion string, params azkeys.KeyOperationParameters) (*KeyVaultDecryptResponse, error) // Sign a message using a key stored in the Key Vault Sign(ctx context.Context, vault, keyName, keyVersion string, params azkeys.SignParameters) (*KeyVaultSignResponse, error) // Verify a signature using a key stored in the Key Vault Verify(ctx context.Context, vault, keyName, keyVersion string, params azkeys.VerifyParameters) (*KeyVaultVerifyResponse, error) }
Client is a client for Azure Key Vault
type ClientFactory ¶
type ClientFactory func(opts ClientOptions) Client
ClientFactory is the type for the NewClient function
type ClientOptions ¶ added in v1.3.0
type ClientOptions struct { AccessToken string Expiration time.Time Tracer *sdkTrace.TracerProvider }
type KeyVaultDecryptResponse ¶
type KeyVaultDecryptResponse struct { Data []byte `json:"data,omitempty"` // contains filtered or unexported fields }
KeyVaultDecryptResponse is the response from the Decrypt and UnwrapKey methods
func (KeyVaultDecryptResponse) KeyID ¶
func (b KeyVaultDecryptResponse) KeyID() string
KeyID returns the key ID
func (KeyVaultDecryptResponse) Raw ¶
func (d KeyVaultDecryptResponse) Raw() []byte
Raw returns the raw response
type KeyVaultEncryptResponse ¶
type KeyVaultEncryptResponse struct { Data []byte `json:"data,omitempty"` Nonce []byte `json:"nonce,omitempty"` Tag []byte `json:"tag,omitempty"` // contains filtered or unexported fields }
KeyVaultEncryptResponse is the response from the Encrypt and WrapKey methods
func (KeyVaultEncryptResponse) KeyID ¶
func (b KeyVaultEncryptResponse) KeyID() string
KeyID returns the key ID
func (KeyVaultEncryptResponse) Raw ¶
func (e KeyVaultEncryptResponse) Raw() []byte
Raw returns the raw response
type KeyVaultResponse ¶
type KeyVaultResponse interface { // Raw returns the raw response Raw() []byte // KeyID returns the key ID KeyID() string }
KeyVaultResponse is the interface implemented by all response objects returned by the methods in this package
type KeyVaultSignResponse ¶
type KeyVaultSignResponse struct { Data []byte `json:"data,omitempty"` // contains filtered or unexported fields }
KeyVaultSignResponse is the response from the Sign method
func (KeyVaultSignResponse) KeyID ¶
func (b KeyVaultSignResponse) KeyID() string
KeyID returns the key ID
func (KeyVaultSignResponse) Raw ¶
func (s KeyVaultSignResponse) Raw() []byte
Raw returns the raw response
type KeyVaultVerifyResponse ¶
type KeyVaultVerifyResponse struct { Valid bool `json:"valid,omitempty"` // contains filtered or unexported fields }
KeyVaultVerifyResponse is the response from the Verify method
func (KeyVaultVerifyResponse) KeyID ¶
func (b KeyVaultVerifyResponse) KeyID() string
KeyID returns the key ID
func (KeyVaultVerifyResponse) Raw ¶
func (v KeyVaultVerifyResponse) Raw() []byte
Raw returns the raw response