Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeString(s string) ([]byte, error)
- func EncodeRecipient(r *OpRecipient) string
- func Marshal(w io.Writer)
- func MarshalIdentity(i *OpIdentity, w io.Writer) error
- func MarshalStanza(s *age.Stanza, w io.Writer) error
- func NewIndexedErrorStanza(kind string, index int, err error) *age.Stanza
- func NewInternalErrorStanza(err error) *age.Stanza
- func ParseStanza(rr *bufio.Reader) (*age.Stanza, error)
- func ReadKeyOp(privateKeyPath string) ([]byte, error)
- func SetLogger(w io.Writer)
- func SplitArgs(line []byte) (string, []string)
- type OpIdentity
- type OpRecipient
- type ParseError
- type StanzaReader
- type WrappedBase64Encoder
- type WriterFunc
Constants ¶
View Source
const BytesPerLine = ColumnsPerLine / 4 * 3
View Source
const ColumnsPerLine = 64
View Source
const (
Name = "op"
)
Variables ¶
View Source
var (
Log *log.Logger
)
Functions ¶
func DecodeString ¶
func EncodeRecipient ¶
func EncodeRecipient(r *OpRecipient) string
func MarshalIdentity ¶
func MarshalIdentity(i *OpIdentity, w io.Writer) error
func NewIndexedErrorStanza ¶
func NewInternalErrorStanza ¶
Types ¶
type OpIdentity ¶
type OpIdentity struct { Version uint8 // contains filtered or unexported fields }
func CreateIdentity ¶
func CreateIdentity(privateKeyPath string) (*OpIdentity, error)
CreateIdentity creates a new identity. Returns the identity and the corresponding recipient.
func DecodeIdentity ¶
func DecodeIdentity(s string) (*OpIdentity, error)
func NewOpIdentity ¶
func NewOpIdentity(privateKeyPath string) *OpIdentity
func (*OpIdentity) Recipient ¶
func (i *OpIdentity) Recipient() *OpRecipient
type OpRecipient ¶
type OpRecipient struct {
// contains filtered or unexported fields
}
func DecodeRecipient ¶
func DecodeRecipient(s string) (*OpRecipient, error)
func NewRecipient ¶
func NewRecipient(opPath string) *OpRecipient
func (*OpRecipient) Identity ¶
func (r *OpRecipient) Identity() *OpIdentity
func (*OpRecipient) String ¶
func (r *OpRecipient) String() string
func (*OpRecipient) Tag ¶
func (r *OpRecipient) Tag() []byte
Tag returns the 4 first bytes of the path to the key this is used to find the correct identity in a stanza
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶
func (e *ParseError) Unwrap() error
type StanzaReader ¶
type StanzaReader struct {
// contains filtered or unexported fields
}
func NewStanzaReader ¶
func NewStanzaReader(r *bufio.Reader) *StanzaReader
func (*StanzaReader) ReadStanza ¶
func (r *StanzaReader) ReadStanza() (s *age.Stanza, err error)
type WrappedBase64Encoder ¶
type WrappedBase64Encoder struct {
// contains filtered or unexported fields
}
WrappedBase64Encoder is a standard base64 encoder that inserts an LF character every ColumnsPerLine bytes. It does not insert a newline neither at the beginning nor at the end of the stream, but it ensures the last line is shorter than ColumnsPerLine, which means it might be empty.
func NewWrappedBase64Encoder ¶
func NewWrappedBase64Encoder(enc *base64.Encoding, dst io.Writer) *WrappedBase64Encoder
NewWrappedBase64Encoder returns a WrappedBase64Encoder that writes to dst.
func (*WrappedBase64Encoder) Close ¶
func (w *WrappedBase64Encoder) Close() error
Click to show internal directories.
Click to hide internal directories.