From ccd4dd9c3becef439b3178b373249946ef8fc465 Mon Sep 17 00:00:00 2001 From: Maxwell Krohn Date: Sat, 2 Jan 2016 16:00:15 -0500 Subject: [PATCH] implement PolicyURI --- openpgp/packet/signature.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openpgp/packet/signature.go b/openpgp/packet/signature.go index 25f13e905b..439439f537 100644 --- a/openpgp/packet/signature.go +++ b/openpgp/packet/signature.go @@ -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 @@ -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 @@ -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)))