aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm_parse.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 07:39:49 +0000
committerGravatar Runxi Yu2026-04-02 07:39:49 +0000
commitb5251cf0b42a7ff13c39b327222175d581b62a83 (patch)
tree3ac391eebfd58c95c63863678888886375ea1dfd /object/id/algorithm_parse.go
parentobject/id: Add algorithm stuff (diff)
signatureNo signature
object/id: Add more object ID stuff
Diffstat (limited to 'object/id/algorithm_parse.go')
-rw-r--r--object/id/algorithm_parse.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/object/id/algorithm_parse.go b/object/id/algorithm_parse.go
index 7349288f..63db32dc 100644
--- a/object/id/algorithm_parse.go
+++ b/object/id/algorithm_parse.go
@@ -6,3 +6,11 @@ func ParseAlgorithm(s string) (Algorithm, bool) {
return algo, ok
}
+
+// ParseSignatureHeaderName parses one canonical signature header name
+// such as "gpgsig" or "gpgsig-sha256" to its respective algorithm.
+func ParseSignatureHeaderName(s string) (Algorithm, bool) {
+ algo, ok := algorithmBySignatureHeaderName[s]
+
+ return algo, ok
+}