Documentation
¶
Overview ¶
Package azurekeyvault provides the same repository-style cryptographic API as the local package, specialized for Azure Key Vault integration points.
Until Azure SDK integration is added to this repository, the package keeps local-only primitives delegated to the local implementation and returns explicit errors for provider-managed asymmetric operations that require a Key Vault-backed private key.
When a provider key identifier is needed, the package reads it from viper using "encrypt.vault.azure-key-vault.key-id".
Index ¶
- func ParseEd25519PrivateKeyFromBase64(b64 string) (ed25519.PrivateKey, error)
- func ParseEd25519PublicKeyFromBase64(b64 string) (ed25519.PublicKey, error)
- func ParseRSAPrivateKeyFromBase64(b64 string) (*rsa.PrivateKey, error)
- func ParseRSAPublicKeyFromBase64(b64 string) (*rsa.PublicKey, error)
- type AsymmetricRepository
- type HashRepository
- type Repository
- type SignatureRepository
- type SymmetricRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseEd25519PrivateKeyFromBase64 ¶
func ParseEd25519PrivateKeyFromBase64(b64 string) (ed25519.PrivateKey, error)
ParseEd25519PrivateKeyFromBase64 decodes a Base64-encoded Ed25519 private key.
func ParseEd25519PublicKeyFromBase64 ¶
ParseEd25519PublicKeyFromBase64 decodes a Base64-encoded Ed25519 public key.
func ParseRSAPrivateKeyFromBase64 ¶
func ParseRSAPrivateKeyFromBase64(b64 string) (*rsa.PrivateKey, error)
ParseRSAPrivateKeyFromBase64 decodes a Base64-encoded RSA private key.
Types ¶
type AsymmetricRepository ¶
type AsymmetricRepository interface {
GeneratesRSAKey(size common.SizeAsymetrycKey) (priv string, pub string, _ error)
RSA_OAEP_Encode(key, text string) (string, error)
RSA_OAEP_Decode(key, cipherText string) (string, error)
}
func NewAsymmetricRepository ¶
func NewAsymmetricRepository() AsymmetricRepository
type HashRepository ¶
type HashRepository interface {
GenerateHMAC(message, secretKey string) string
ValidateHMAC(message, secretKey, providedHash string) bool
Sha256Hex(message string) string
Blake3(message string) string
}
func NewHashRepository ¶
func NewHashRepository() HashRepository
type Repository ¶
type Repository interface {
SymmetricRepository
AsymmetricRepository
SignatureRepository
HashRepository
}
func NewRepository ¶
func NewRepository() Repository
type SignatureRepository ¶
type SignatureRepository interface {
GeneratesEd255Key(size common.SizeAsymetrycKey) (priv string, pub string, _ error)
SignEd25519(key, text string) (string, error)
VerifyEd25519(key, text, signature string) error
SignRSAPSS(key, text string) (string, error)
VerifyRSAPSS(key, text, signature string) error
SignSHA256(data string, privateKey *rsa.PrivateKey) (string, error)
VerifySHA256(data, signature string, publicKey *rsa.PublicKey) error
}
func NewSignatureRepository ¶
func NewSignatureRepository() SignatureRepository
type SymmetricRepository ¶
type SymmetricRepository interface {
GeneratesSymetrycKey(size common.SizeSymetrycKey) (string, error)
EncryptAES(symmetricalAccess, value, additionalData string) (string, error)
DecryptAES(symmetricalAccess, cipherValue, additionalData string) (string, error)
EncodeFernet(keyString, value string) (string, error)
DecodeFernet(keyString, cipherValue string) (string, error)
}
func NewSymmetricRepository ¶
func NewSymmetricRepository() SymmetricRepository