Documentation ¶
Overview ¶
Package age implements file encryption according to age-encryption.org/v1.
Index ¶
- Variables
- func Decrypt(src io.Reader, identities ...Identity) (io.Reader, error)
- func Encrypt(dst io.Writer, recipients ...Recipient) (io.WriteCloser, error)
- func EncryptWithArmor(dst io.Writer, recipients ...Recipient) (io.WriteCloser, error)
- func SSHFingerprint(pk ssh.PublicKey) string
- type Identity
- type IdentityMatcher
- type Recipient
- type SSHEd25519Identity
- type SSHEd25519Recipient
- type SSHRSAIdentity
- type SSHRSARecipient
- type ScryptIdentity
- type ScryptRecipient
- type X25519Identity
- type X25519Recipient
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIncorrectIdentity = errors.New("incorrect identity for recipient block")
Functions ¶
func EncryptWithArmor ¶
func SSHFingerprint ¶
Types ¶
type Identity ¶
type Identity interface { Type() string Unwrap(block *format.Recipient) (fileKey []byte, err error) }
func ParseSSHIdentity ¶
type IdentityMatcher ¶
type Recipient ¶
func ParseSSHRecipient ¶
type SSHEd25519Identity ¶
type SSHEd25519Identity struct {
// contains filtered or unexported fields
}
func NewSSHEd25519Identity ¶
func NewSSHEd25519Identity(key ed25519.PrivateKey) (*SSHEd25519Identity, error)
func (*SSHEd25519Identity) Type ¶
func (*SSHEd25519Identity) Type() string
type SSHEd25519Recipient ¶
type SSHEd25519Recipient struct {
// contains filtered or unexported fields
}
func NewSSHEd25519Recipient ¶
func NewSSHEd25519Recipient(pk ssh.PublicKey) (*SSHEd25519Recipient, error)
func (*SSHEd25519Recipient) Type ¶
func (*SSHEd25519Recipient) Type() string
type SSHRSAIdentity ¶
type SSHRSAIdentity struct {
// contains filtered or unexported fields
}
func NewSSHRSAIdentity ¶
func NewSSHRSAIdentity(key *rsa.PrivateKey) (*SSHRSAIdentity, error)
func (*SSHRSAIdentity) Type ¶
func (*SSHRSAIdentity) Type() string
type SSHRSARecipient ¶
type SSHRSARecipient struct {
// contains filtered or unexported fields
}
func NewSSHRSARecipient ¶
func NewSSHRSARecipient(pk ssh.PublicKey) (*SSHRSARecipient, error)
func (*SSHRSARecipient) Type ¶
func (*SSHRSARecipient) Type() string
type ScryptIdentity ¶
type ScryptIdentity struct {
// contains filtered or unexported fields
}
func NewScryptIdentity ¶
func NewScryptIdentity(password string) (*ScryptIdentity, error)
func (*ScryptIdentity) SetMaxWorkFactor ¶
func (i *ScryptIdentity) SetMaxWorkFactor(logN int)
SetWorkFactor sets the maximum accepted scrypt work factor to 2^logN. It must be called before Unwrap.
func (*ScryptIdentity) Type ¶
func (*ScryptIdentity) Type() string
type ScryptRecipient ¶
type ScryptRecipient struct {
// contains filtered or unexported fields
}
func NewScryptRecipient ¶
func NewScryptRecipient(password string) (*ScryptRecipient, error)
func (*ScryptRecipient) SetWorkFactor ¶
func (r *ScryptRecipient) SetWorkFactor(logN int)
SetWorkFactor sets the scrypt work factor to 2^logN. It must be called before Wrap.
func (*ScryptRecipient) Type ¶
func (*ScryptRecipient) Type() string
type X25519Identity ¶
type X25519Identity struct {
// contains filtered or unexported fields
}
func GenerateX25519Identity ¶
func GenerateX25519Identity() (*X25519Identity, error)
func NewX25519Identity ¶
func NewX25519Identity(secretKey []byte) (*X25519Identity, error)
func ParseX25519Identity ¶
func ParseX25519Identity(s string) (*X25519Identity, error)
func (*X25519Identity) Recipient ¶
func (i *X25519Identity) Recipient() *X25519Recipient
func (*X25519Identity) String ¶
func (i *X25519Identity) String() string
func (*X25519Identity) Type ¶
func (*X25519Identity) Type() string
type X25519Recipient ¶
type X25519Recipient struct {
// contains filtered or unexported fields
}
func NewX25519Recipient ¶
func NewX25519Recipient(publicKey []byte) (*X25519Recipient, error)
func ParseX25519Recipient ¶
func ParseX25519Recipient(s string) (*X25519Recipient, error)
func (*X25519Recipient) String ¶
func (r *X25519Recipient) String() string
func (*X25519Recipient) Type ¶
func (*X25519Recipient) Type() string
Click to show internal directories.
Click to hide internal directories.