status

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2019 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// If you add a type, remember to handle it in all the switch statements.
	UnsetType WarningType = 0

	PrimaryKeyDueForRotation     = 1
	PrimaryKeyOverdueForRotation = 2
	PrimaryKeyExpired            = 3
	PrimaryKeyNoExpiry           = 4

	NoValidEncryptionSubkey  = 6
	SubkeyDueForRotation     = 7
	SubkeyOverdueForRotation = 8
	SubkeyNoExpiry           = 9

	MissingPreferredSymmetricAlgorithms    = 11
	WeakPreferredSymmetricAlgorithms       = 12
	UnsupportedPreferredSymmetricAlgorithm = 13

	MissingPreferredHashAlgorithms    = 14
	WeakPreferredHashAlgorithms       = 15
	UnsupportedPreferredHashAlgorithm = 16

	MissingPreferredCompressionAlgorithms    = 17
	UnsupportedPreferredCompressionAlgorithm = 18
	MissingUncompressedPreference            = 19 // Implementations MUST implement uncompressed data.

	WeakSelfSignatureHash          = 20
	WeakSubkeyBindingSignatureHash = 21

	ConfigMaintainAutomaticallyNotSet         = 22
	ConfigPublishToAPINotSet                  = 23
	ConfigMaintainAutomaticallyButDontPublish = 24
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateNewEncryptionSubkey

type CreateNewEncryptionSubkey struct {
	KeyAction

	ValidUntil time.Time
}

CreateNewEncryptionSubkey creates a new subkey with the given ValidUntil expiry time and a subkey binding signature.

func (CreateNewEncryptionSubkey) Enact

func (a CreateNewEncryptionSubkey) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (CreateNewEncryptionSubkey) SortOrder

func (a CreateNewEncryptionSubkey) SortOrder() int

func (CreateNewEncryptionSubkey) String

func (a CreateNewEncryptionSubkey) String() string

type KeyAction

type KeyAction interface {
	String() string
	Enact(*pgpkey.PgpKey, time.Time, *string) error
	SortOrder() int
}

func MakeActionsFromWarnings

func MakeActionsFromWarnings(warnings []KeyWarning, now time.Time) []KeyAction

MakeActionsFromWarnings returns a list of actions that can be performed on the key to fix the warning. Call `KeyAction.Enact(key)` to actually carry out the action.

type KeyWarning

type KeyWarning struct {
	Type WarningType

	SubkeyId          uint64
	DaysUntilExpiry   uint
	DaysSinceExpiry   uint
	CurrentValidUntil *time.Time
	Detail            string
}

func GetKeyWarnings

func GetKeyWarnings(key pgpkey.PgpKey, config *config.Config) []KeyWarning

GetKeyWarnings returns a slice of KeyWarnings indicating problems found with the given PgpKey.

func (KeyWarning) String

func (w KeyWarning) String() string

type ModifyPrimaryKeyExpiry

type ModifyPrimaryKeyExpiry struct {
	KeyAction

	ValidUntil           time.Time
	PreviouslyValidUntil *time.Time
}

ModifyPrimaryKeyExpiry iterates over all user IDs. For each UID, it updates the expiry date on the *self signature*. It re-signs the self signature.

func (ModifyPrimaryKeyExpiry) Enact

func (a ModifyPrimaryKeyExpiry) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (ModifyPrimaryKeyExpiry) SortOrder

func (a ModifyPrimaryKeyExpiry) SortOrder() int

func (ModifyPrimaryKeyExpiry) String

func (a ModifyPrimaryKeyExpiry) String() string

type ModifySubkeyExpiry added in v1.1.0

type ModifySubkeyExpiry struct {
	KeyAction
	// contains filtered or unexported fields
}

ModifySubkeyExpiry iterates over all user IDs. For each UID, it updates the expiry date on the *self signature*. It re-signs the self signature.

func (ModifySubkeyExpiry) Enact added in v1.1.0

func (a ModifySubkeyExpiry) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (ModifySubkeyExpiry) SortOrder added in v1.1.0

func (a ModifySubkeyExpiry) SortOrder() int

func (ModifySubkeyExpiry) String added in v1.1.0

func (a ModifySubkeyExpiry) String() string

type RefreshSubkeyBindingSignature

type RefreshSubkeyBindingSignature struct {
	KeyAction
	SubkeyId uint64
}

RefreshSubkeyBindingSignature re-signs the subkey binding signature for the given SubkeyId. This is useful if the old signature uses a weak hash.

func (RefreshSubkeyBindingSignature) Enact

func (a RefreshSubkeyBindingSignature) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (RefreshSubkeyBindingSignature) SortOrder

func (a RefreshSubkeyBindingSignature) SortOrder() int

func (RefreshSubkeyBindingSignature) String

type RefreshUserIdSelfSignatures

type RefreshUserIdSelfSignatures struct {
	KeyAction
}

RefreshUserIdSelfSignatures iterates over user ids and re-signs the self signatures. This is useful if the old signature uses a weak hash.

func (RefreshUserIdSelfSignatures) Enact

func (a RefreshUserIdSelfSignatures) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (RefreshUserIdSelfSignatures) SortOrder

func (a RefreshUserIdSelfSignatures) SortOrder() int

func (RefreshUserIdSelfSignatures) String

type SetPreferredCompressionAlgorithms

type SetPreferredCompressionAlgorithms struct {
	KeyAction

	NewPreferences []compression.CompressionAlgorithm
}

SetPreferredCompressionAlgorithms iterates over all user IDs, setting the preferred compression algorithm preferences from NewPreferences. It re-signs the self signature on each user ID.

func (SetPreferredCompressionAlgorithms) Enact

func (a SetPreferredCompressionAlgorithms) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (SetPreferredCompressionAlgorithms) SortOrder

func (a SetPreferredCompressionAlgorithms) SortOrder() int

func (SetPreferredCompressionAlgorithms) String

type SetPreferredHashAlgorithms

type SetPreferredHashAlgorithms struct {
	KeyAction

	NewPreferences []hash.HashAlgorithm
}

SetPreferredHashAlgorithms iterates over all user IDs, setting the preferred hash algorithm preferences from NewPreferences It re-signs the self signature on each user ID.

func (SetPreferredHashAlgorithms) Enact

func (a SetPreferredHashAlgorithms) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (SetPreferredHashAlgorithms) SortOrder

func (a SetPreferredHashAlgorithms) SortOrder() int

func (SetPreferredHashAlgorithms) String

type SetPreferredSymmetricAlgorithms

type SetPreferredSymmetricAlgorithms struct {
	KeyAction

	NewPreferences []symmetric.SymmetricAlgorithm
}

SetPreferredSymmetricAlgorithms iterates over all user IDs, setting the preferred symmetric algorithm preferences from NewPreferences It re-signs the self signature on each user ID.

func (SetPreferredSymmetricAlgorithms) Enact

func (a SetPreferredSymmetricAlgorithms) Enact(key *pgpkey.PgpKey, now time.Time, password *string) error

func (SetPreferredSymmetricAlgorithms) SortOrder

func (a SetPreferredSymmetricAlgorithms) SortOrder() int

func (SetPreferredSymmetricAlgorithms) String

type WarningType

type WarningType int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL