Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

implement PolicyURI #3

Merged
merged 1 commit into from
Jan 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions openpgp/packet/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ type Signature struct {
RevocationReason *uint8
RevocationReasonText string

// PolicyURI is an optional. See RFC 4880, Section 5.2.3.20 for details
PolicyURI string

// MDC is set if this signature has a feature packet that indicates
// support for MDC subpackets.
MDC bool
Expand Down Expand Up @@ -205,6 +208,7 @@ const (
prefHashAlgosSubpacket signatureSubpacketType = 21
prefCompressionSubpacket signatureSubpacketType = 22
primaryUserIdSubpacket signatureSubpacketType = 25
policyURI signatureSubpacketType = 26
keyFlagsSubpacket signatureSubpacketType = 27
reasonForRevocationSubpacket signatureSubpacketType = 29
featuresSubpacket signatureSubpacketType = 30
Expand Down Expand Up @@ -386,6 +390,9 @@ func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (r
if sigType := sig.EmbeddedSignature.SigType; sigType != SigTypePrimaryKeyBinding {
return nil, errors.StructuralError("cross-signature has unexpected type " + strconv.Itoa(int(sigType)))
}
case policyURI:
// See RFC 4880, Section 5.2.3.20
sig.PolicyURI = string(subpacket[:])
default:
if isCritical {
err = errors.UnsupportedError("unknown critical signature subpacket type " + strconv.Itoa(int(packetType)))
Expand Down