Documentation
¶
Overview ¶
Package utils contains helper functions related to the sop implementation of gopenpgp.
Index ¶
- Constants
- Variables
- func CollectFilesFromCliSlice(data []string) []string
- func CollectKeys(keyFilenames ...string) (*crypto.KeyRing, error)
- func CollectKeysPassword(password []byte, keyFilenames ...string) (*crypto.KeyRing, bool, error)
- func Linebreak()
- func OpenOutFile(filename string) (*os.File, error)
- func ParseDates(notBefore, notAfter string) (nb, na time.Time, err error)
- func ParseUserID(id string) (x, y, z string, err error)
- func ReadFileOrEnv(filename string) ([]byte, error)
- func ReadSanitizedPassword(filename string) ([]byte, error)
- func VerificationString(timestamp time.Time, fgp, primFgp []byte, mode string) string
- type SopProfile
Constants ¶
View Source
const ArmorPrefix = ""
View Source
const DefaultProfileName string = "default"
Variables ¶
View Source
var EncryptionProfiles = createEncryptionProfiles()
View Source
var KeyGenerationProfiles = createKeyGenerationProfiles()
Functions ¶
func CollectFilesFromCliSlice ¶ added in v1.0.0
func CollectKeys ¶
CollectKeys forms a crypto.KeyRing with all the keys provided in the input files. It returns the keyring and an error.
func CollectKeysPassword ¶ added in v1.0.0
CollectKeysPassword forms a crypto.KeyRing with all the keys provided in the input files and tries to unlock them with password if locked. It returns the keyring, a bool indicating an unlock issue, and an error.
func ParseDates ¶
ParseDates reads --not-before and --not-after flags, and parses them according to the layout.
func ParseUserID ¶
ParseUserID takes a string of the form "x (y) <z>" and outputs x, y, z and an error. Note that x, y may contain whitespaces.
func ReadFileOrEnv ¶
func ReadSanitizedPassword ¶ added in v1.0.0
Types ¶
type SopProfile ¶ added in v1.0.0
type SopProfile struct {
Names []string
Description string
PgpProfile *profile.Custom
SecurityLevel int8 // Only applies to key generation.
}
func SelectEncryptionProfile ¶ added in v1.0.0
func SelectEncryptionProfile(name string) (selectedProfile *SopProfile)
func SelectKeyGenerationProfile ¶ added in v1.0.0
func SelectKeyGenerationProfile(name string) (selectedProfile *SopProfile)
Click to show internal directories.
Click to hide internal directories.