Documentation
¶
Index ¶
Constants ¶
const ( // The encryption key size is set so it has the same entropy as the derived // key. EncryptionKeySize = 32 // XXX: needs to be in sync with // github.com/snapcore/secboot/crypto.go:"type RecoveryKey" // Size of the recovery key. RecoveryKeySize = 16 // The auxiliary key is used to bind keys to models AuxKeySize = 32 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptionKey ¶
type EncryptionKey []byte
EncryptionKey is the key used to encrypt the data partition.
func NewEncryptionKey ¶
func NewEncryptionKey() (EncryptionKey, error)
func (EncryptionKey) Save ¶
func (key EncryptionKey) Save(filename string) error
Save writes the key in the location specified by filename.
type KeyDataWriter ¶
KeyDataWriter is a the same as KeyDataWriter from github.com/canonical/secboot.
type PlainKey ¶
type PlainKey struct {
// contains filtered or unexported fields
}
PlainKey is a wrapper for a secboot KeyData representing a plainkey.
func (*PlainKey) Write ¶
func (key *PlainKey) Write(writer KeyDataWriter) error
Write writes a PlainKey to a KeyDataWriter.
type ProtectorKey ¶
type ProtectorKey []byte
ProtectorKey is a key that can be used to protect "plainkey" keys.
func NewProtectorKey ¶
func NewProtectorKey() (ProtectorKey, error)
NewProtectorKey creates a new random ProtectorKey.
func (ProtectorKey) CreateProtectedKey ¶
CreateProtectedKey creates a protected key for a given ProtectorKey and primary key. It returns a the protected key wrapped as a PlainKey as well the used primary key and the unlock key. If primaryKey is nil, the primary key will be generated.
func (ProtectorKey) SaveToFile ¶
func (key ProtectorKey) SaveToFile(path string) error
SaveToFile saves the ProtectorKey to a file at given path.
type RecoveryKey ¶
type RecoveryKey [RecoveryKeySize]byte
RecoveryKey is a key used to unlock the encrypted partition when the encryption key can't be used, for example when unseal fails.
func NewRecoveryKey ¶
func NewRecoveryKey() (RecoveryKey, error)
func RecoveryKeyFromFile ¶
func RecoveryKeyFromFile(recoveryKeyFile string) (*RecoveryKey, error)
func (RecoveryKey) Save ¶
func (key RecoveryKey) Save(filename string) error
Save writes the recovery key in the location specified by filename.
func (RecoveryKey) String ¶
func (k RecoveryKey) String() string