23 lines
672 B
Go
23 lines
672 B
Go
package secret
|
|
|
|
import (
|
|
"filippo.io/age"
|
|
)
|
|
|
|
// UnlockKey interface defines the methods all unlock key types must implement
|
|
type UnlockKey interface {
|
|
GetIdentity() (*age.X25519Identity, error)
|
|
GetType() string
|
|
GetMetadata() UnlockKeyMetadata
|
|
GetDirectory() string
|
|
GetID() string
|
|
ID() string // Generate ID from the key's public key
|
|
Remove() error // Remove the unlock key and any associated resources
|
|
|
|
// DecryptLongTermKey decrypts and returns the long-term private key for this vault
|
|
DecryptLongTermKey() ([]byte, error)
|
|
|
|
// DecryptSecret decrypts a secret using this unlock key's long-term key management
|
|
DecryptSecret(secret *Secret) ([]byte, error)
|
|
}
|