diff --git a/fips.go b/fips.go new file mode 100644 index 000000000..01ed2fb57 --- /dev/null +++ b/fips.go @@ -0,0 +1,13 @@ +package notary + +import "os" + +// FIPSEnvVar is the name of the environment variable that is being used to switch +// between FIPS and non-FIPS mode +const FIPSEnvVar = "GOFIPS" + +// FIPSEnabled returns true if environment variable `GOFIPS` has been set to enable +// FIPS mode +func FIPSEnabled() bool { + return os.Getenv(FIPSEnvVar) != "" +}