Documentation
¶
Index ¶
Constants ¶
View Source
const ( // default privage secret key. It can be an age key of a PIV encoded age // key. DefaultFileName = "privage-key.txt" TypePiv = "PIV" TypeAge = "AGE" )
Variables ¶
This section is empty.
Functions ¶
func BackupFilePath ¶
BackupFilePath returns a path for a backup identity file.
func DecryptPiv ¶ added in v0.23.0
DecryptPiv returns the decrypted contents read from r, using the PIV device to decrypt with the key in the specified slot.
func GenerateAge ¶ added in v0.23.0
GenerateAge generates an age Identity and writes it to the writer.
Types ¶
type Device ¶ added in v0.23.0
type Device interface {
// Decrypt decrypts ciphertext using the key in the specified slot.
Decrypt(ciphertext []byte, slot uint32) ([]byte, error)
// Encrypt encrypts plaintext using the key in the specified slot and writes
// the result to w.
Encrypt(w io.Writer, plaintext []byte, slot uint32) error
// Close releases any resources associated with the device.
Close() error
}
Device represents a PIV-compatible hardware device that can perform cryptographic operations like decryption.
type Identity ¶
type Identity struct {
// The age identity
Id *age.X25519Identity
// Path of the found key.
// Path can contain a normal age key or a PIV encrypted one.
//
// Path can be not empty and still a null Id because of a decoding error.
//
// A empty Path means all possible paths were searched and no files were
// found
Path string
// Err is the error raised finding or validating the a age identity.
Err error
}
An Identity is a wrapper for the age Identity.
func LoadAge ¶ added in v0.23.0
LoadAge returns an Age identity from an io.Reader. The path parameter is used for error messages and tracking.
Click to show internal directories.
Click to hide internal directories.