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

25 lines
383 B
Go

package check
import (
"errors"
"os"
"github.com/pojntfx/stfs/pkg/config"
)
var (
ErrKeyNotAccessible = errors.New("key not found or accessible")
)
func CheckKeyAccessible(encryptionFormat string, pathToKey string) error {
if encryptionFormat == config.NoneKey {
return nil
}
if _, err := os.Stat(pathToKey); err != nil {
return ErrKeyNotAccessible
}
return nil
}