aboutsummaryrefslogtreecommitdiff
path: root/object/signed/commit/signature_algorithms.go
diff options
context:
space:
mode:
Diffstat (limited to 'object/signed/commit/signature_algorithms.go')
-rw-r--r--object/signed/commit/signature_algorithms.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/object/signed/commit/signature_algorithms.go b/object/signed/commit/signature_algorithms.go
new file mode 100644
index 00000000..ac763706
--- /dev/null
+++ b/object/signed/commit/signature_algorithms.go
@@ -0,0 +1,16 @@
+package signedcommit
+
+import objectid "codeberg.org/lindenii/furgit/object/id"
+
+// Algorithms returns the algorithms for which the commit carries signatures.
+func (commit *Commit) Algorithms() []objectid.Algorithm {
+ var algorithms []objectid.Algorithm
+
+ for _, algo := range objectid.SupportedAlgorithms() {
+ if _, ok := commit.signatures[algo]; ok {
+ algorithms = append(algorithms, algo)
+ }
+ }
+
+ return algorithms
+}