Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPrivateKeyFormat(key string) bool
- func CheckPublicKeyFormat(key string) bool
- func DecryptWithPwd(p Parameters, pwd string) ([]byte, error)
- func EncryptWithPwd(p Parameters, pwd string) ([]byte, error)
- func GenKeypair() (*age.X25519Identity, error)
- func GenSecretKey() (string, error)
- type AgeV1Obf
- type CustomObf
- type Keychain
- type Obfuscation
- type Parameters
- type Reader
- type SetupKeychainParameters
- type Writer
Constants ¶
View Source
const AgePrivateKeyPattern = "^AGE-SECRET-KEY-1[A-Z0-9]{58}$"
View Source
const AgePublicKeyPattern = "^age1[a-z0-9]{58}$"
View Source
const ChunkSize = 64 * 1024
Variables ¶
View Source
var ErrInvalidHeader = errors.New("invalid header")
View Source
var ErrInvalidHeaderLength = errors.New("invalid header length")
View Source
var ErrMissingFlag = errors.New("missing end flag")
Functions ¶
func CheckPrivateKeyFormat ¶ added in v0.1.1
func CheckPublicKeyFormat ¶ added in v0.1.1
func DecryptWithPwd ¶
func DecryptWithPwd(p Parameters, pwd string) ([]byte, error)
func EncryptWithPwd ¶
func EncryptWithPwd(p Parameters, pwd string) ([]byte, error)
func GenKeypair ¶
func GenKeypair() (*age.X25519Identity, error)
func GenSecretKey ¶ added in v0.1.1
Types ¶
type CustomObf ¶ added in v0.1.1
func (*CustomObf) Deobfuscate ¶ added in v0.1.1
type Keychain ¶
type Keychain struct {
// contains filtered or unexported fields
}
func SetupKeychain ¶
func SetupKeychain(keychainSetup SetupKeychainParameters) (Keychain, error)
func (Keychain) KeychainExport ¶
func (Keychain) KeychainExportSecretKey ¶
type Obfuscation ¶
type Obfuscation interface { Obfuscate([]byte) ([]byte, error) Deobfuscate([]byte) ([]byte, error) }
Age keyslot header obfuscation
type Parameters ¶
type Parameters struct { Data []byte Compressor compression.Compressor Obfuscator Obfuscation }
type SetupKeychainParameters ¶
Click to show internal directories.
Click to hide internal directories.