MCPcopy
hub / github.com/getsops/sops / ImportFile

Method ImportFile

pgp/keysource.go:171–177  ·  view source on GitHub ↗

ImportFile attempts to import the armored key file into the GnuPGHome keyring. It returns an error if the GnuPGHome does not pass Validate, or if the import failed.

(path string)

Source from the content-addressed store, hash-verified

169// It returns an error if the GnuPGHome does not pass Validate, or if the
170// import failed.
171func (d GnuPGHome) ImportFile(path string) error {
172 b, err := os.ReadFile(path)
173 if err != nil {
174 return fmt.Errorf("cannot read armored key data from file: %w", err)
175 }
176 return d.Import(b)
177}
178
179// Cleanup deletes the GnuPGHome if it passes Validate.
180// It returns an error if the GnuPGHome does not pass Validate, or if the

Calls 1

ImportMethod · 0.95