Documentation
¶
Index ¶
- Variables
- type BackendType
- type FileKey
- type KeyBackend
- type KeyHierarchy
- func (k *KeyHierarchy) GetConfig(keydir string) *config.Keys
- func (k *KeyHierarchy) GetKeyBackend(e efivar.Efivar) KeyBackend
- func (k *KeyHierarchy) RotateKey(hier hierarchy.Hierarchy) error
- func (k *KeyHierarchy) RotateKeyWithBackend(hier hierarchy.Hierarchy, backend BackendType) error
- func (k *KeyHierarchy) RotateKeys() error
- func (k *KeyHierarchy) SaveKey(vfs afero.Fs, hier hierarchy.Hierarchy, keydir string) error
- func (k *KeyHierarchy) SaveKeys(fs afero.Fs, keydir string) error
- func (k *KeyHierarchy) SignFile(hier hierarchy.Hierarchy, peBinary *authenticode.PECOFFBinary) ([]byte, error)
- func (k *KeyHierarchy) VerifyFile(hier hierarchy.Hierarchy, r io.ReaderAt) (bool, error)
- type TPMKey
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAlreadySigned = errors.New("already signed file")
)
View Source
var RSAKeySize = 4096
Functions ¶
This section is empty.
Types ¶
type BackendType ¶
type BackendType string
const ( FileBackend BackendType = "file" YubikeyBackend BackendType = "yubikey" TPMBackend BackendType = "tpm" )
func GetBackendType ¶
func GetBackendType(b []byte) (BackendType, error)
type FileKey ¶
type FileKey struct {
// contains filtered or unexported fields
}
func FileKeyFromBytes ¶
func ReadFileKey ¶
func (*FileKey) Certificate ¶
func (f *FileKey) Certificate() *x509.Certificate
func (*FileKey) CertificateBytes ¶
func (*FileKey) Description ¶
func (*FileKey) PrivateKeyBytes ¶
func (*FileKey) Type ¶
func (f *FileKey) Type() BackendType
type KeyBackend ¶
type KeyBackend interface { CertificateBytes() []byte PrivateKeyBytes() []byte Signer() crypto.Signer Certificate() *x509.Certificate Type() BackendType Description() string }
func GetKeyBackend ¶
func InitBackendFromKeys ¶
type KeyHierarchy ¶
type KeyHierarchy struct { PK KeyBackend KEK KeyBackend Db KeyBackend // contains filtered or unexported fields }
func CreateKeys ¶
func CreateKeys(state *config.State) (*KeyHierarchy, error)
func GetKeyHierarchy ¶
func NewKeyHierarchy ¶
func NewKeyHierarchy(state *config.State) *KeyHierarchy
func (*KeyHierarchy) GetKeyBackend ¶
func (k *KeyHierarchy) GetKeyBackend(e efivar.Efivar) KeyBackend
func (*KeyHierarchy) RotateKeyWithBackend ¶
func (k *KeyHierarchy) RotateKeyWithBackend(hier hierarchy.Hierarchy, backend BackendType) error
func (*KeyHierarchy) RotateKeys ¶
func (k *KeyHierarchy) RotateKeys() error
func (*KeyHierarchy) SignFile ¶
func (k *KeyHierarchy) SignFile(hier hierarchy.Hierarchy, peBinary *authenticode.PECOFFBinary) ([]byte, error)
func (*KeyHierarchy) VerifyFile ¶
type TPMKey ¶
func ReadTPMKey ¶
func TPMKeyFromBytes ¶
func (*TPMKey) Certificate ¶
func (t *TPMKey) Certificate() *x509.Certificate
func (*TPMKey) CertificateBytes ¶
func (*TPMKey) Description ¶
func (*TPMKey) PrivateKeyBytes ¶
func (*TPMKey) Type ¶
func (t *TPMKey) Type() BackendType
Click to show internal directories.
Click to hide internal directories.