Files
stfs/internal/check/encryption.go
Felicitas Pojtinger 5089333d13 feat: Make STFS API public
Also: Happy new year :)
2021-12-31 23:57:21 +01:00

20 lines
385 B
Go

package check
import "github.com/pojntfx/stfs/pkg/config"
func CheckEncryptionFormat(encryptionFormat string) error {
encryptionFormatIsKnown := false
for _, candidate := range config.KnownEncryptionFormats {
if encryptionFormat == candidate {
encryptionFormatIsKnown = true
}
}
if !encryptionFormatIsKnown {
return config.ErrEncryptionFormatUnknown
}
return nil
}