main
Raw Download raw file
 1package packet
 2
 3// Recipient type represents a Intended Recipient Fingerprint subpacket
 4// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#name-intended-recipient-fingerpr
 5type Recipient struct {
 6	KeyVersion  int
 7	Fingerprint []byte
 8}
 9
10func (r *Recipient) Serialize() []byte {
11	packet := make([]byte, len(r.Fingerprint)+1)
12	packet[0] = byte(r.KeyVersion)
13	copy(packet[1:], r.Fingerprint)
14	return packet
15}