Add IsSupportedHttpSigAlgorithm

このコミットが含まれているのは:
Cory Slep 2019-09-03 19:40:51 +02:00
コミット 50b0c670ec
1個のファイルの変更7行の追加0行の削除

ファイルの表示

@ -258,6 +258,13 @@ func setSig(a hash.Hash, b []byte) error {
return nil
}
// IsSupportedHttpSigAlgorithm returns true if the string is supported by this
// library, is not a hash known to be weak, and is supported by the hardware.
func IsSupportedHttpSigAlgorithm(algo string) bool {
a, err := isAvailable(algo)
return a && err == nil
}
// isAvailable is an internally public function
func isAvailable(algo string) (bool, error) {
c, ok := stringToHash[algo]