aboutsummaryrefslogtreecommitdiff
path: root/object/signed/commit/signature_algorithms.go
blob: 2f83894c7907aa4b0c555d044cfdcb979aea3e69 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package signedcommit

import objectid "lindenii.org/go/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
}