Files
stfs/internal/encryption/check.go
2021-12-08 00:27:46 +01:00

20 lines
390 B
Go

package encryption
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
}