File: recipient.go

package info (click to toggle)
golang-github-protonmail-go-crypto 1.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,932 kB
  • sloc: makefile: 10
file content (15 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package packet

// Recipient type represents a Intended Recipient Fingerprint subpacket
// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#name-intended-recipient-fingerpr
type Recipient struct {
	KeyVersion  int
	Fingerprint []byte
}

func (r *Recipient) Serialize() []byte {
	packet := make([]byte, len(r.Fingerprint)+1)
	packet[0] = byte(r.KeyVersion)
	copy(packet[1:], r.Fingerprint)
	return packet
}