plugin

package
v0.0.0-...-af73d98 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginName = "1p"
)

Variables

View Source
var (
	Log *log.Logger
)

Functions

func EncodeDefaultIdentity

func EncodeDefaultIdentity() string

func EncodeIdentity

func EncodeIdentity(i *Identity) string

func EncodeRecipient

func EncodeRecipient(recipient *Recipient) string

func ListSSHFingerprintsOp

func ListSSHFingerprintsOp() (output []byte, err error)

func MarshalAllRecipients

func MarshalAllRecipients() (out string, err error)

func MarshalRecipient

func MarshalRecipient(pubkey *Recipient, w io.Writer) error

func ReadAllKeysOp

func ReadAllKeysOp() (privateKeyFromOpRef map[string][]byte, err error)

func ReadKeyFromPathOp

func ReadKeyFromPathOp(path string) (key []byte, err error)

func ReadKeyFromPubKeyOp

func ReadKeyFromPubKeyOp(pubKey ssh.PublicKey) (privateKey []byte, err error)

func SetLogger

func SetLogger(w io.Writer)

func UnmarshalItemList

func UnmarshalItemList(output []byte) (items []map[string]interface{}, err error)

func WriteMarshalHeader

func WriteMarshalHeader(w io.Writer)

Types

type DefaultIdentity

type DefaultIdentity struct {
	// contains filtered or unexported fields
}

func NewDefaultIdentity

func NewDefaultIdentity() (*DefaultIdentity, error)

func (*DefaultIdentity) Unwrap

func (d *DefaultIdentity) Unwrap(stanzas []*age.Stanza) (fileKey []byte, err error)

type Identity

type Identity struct {
	Version uint8
	PubKey  ssh.PublicKey
	// contains filtered or unexported fields
}

func CreateIdentityFromPath

func CreateIdentityFromPath(privateKeyPath string) (*Identity, error)

func DecodeIdentity

func DecodeIdentity(s string) (*Identity, error)

func GetAllIdentities

func GetAllIdentities() (identities []Identity, err error)

func NewIdentity

func NewIdentity(privateKey []byte) (*Identity, error)

func ParseIdentity

func ParseIdentity(f io.Reader) (*Identity, error)

func (*Identity) Marshal

func (i *Identity) Marshal(w io.Writer) error

func (*Identity) Recipient

func (i *Identity) Recipient() *Recipient

func (*Identity) Serialize

func (i *Identity) Serialize() []any

func (*Identity) Unwrap

func (i *Identity) Unwrap(stanzas []*age.Stanza) (fileKey []byte, err error)

type Recipient

type Recipient struct {
	PubKey ssh.PublicKey
}

func DecodeRecipient

func DecodeRecipient(s string) (*Recipient, error)

func NewRecipient

func NewRecipient(publicKey ssh.PublicKey) *Recipient

func (*Recipient) MarshalWithDefaultIdentity

func (r *Recipient) MarshalWithDefaultIdentity(w io.Writer) error

func (*Recipient) String

func (r *Recipient) String() string

func (*Recipient) Wrap

func (r *Recipient) Wrap(fileKey []byte) ([]*age.Stanza, error)

Jump to

Keyboard shortcuts

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