main
Raw Download raw file
 1// Copyright 2017 The Go Authors. All rights reserved.
 2// Use of this source code is governed by a BSD-style
 3// license that can be found in the LICENSE file.
 4
 5// Package encoding implements openpgp packet field encodings as specified in
 6// RFC 4880 and 6637.
 7package encoding
 8
 9import "io"
10
11// Field is an encoded field of an openpgp packet.
12type Field interface {
13	// Bytes returns the decoded data.
14	Bytes() []byte
15
16	// BitLength is the size in bits of the decoded data.
17	BitLength() uint16
18
19	// EncodedBytes returns the encoded data.
20	EncodedBytes() []byte
21
22	// EncodedLength is the size in bytes of the encoded data.
23	EncodedLength() uint16
24
25	// ReadFrom reads the next Field from r.
26	ReadFrom(r io.Reader) (int64, error)
27}