diff options
Diffstat (limited to 'lib/crypto/gpg/gpgbin/import.go')
-rw-r--r-- | lib/crypto/gpg/gpgbin/import.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/crypto/gpg/gpgbin/import.go b/lib/crypto/gpg/gpgbin/import.go new file mode 100644 index 00000000..49e178b5 --- /dev/null +++ b/lib/crypto/gpg/gpgbin/import.go @@ -0,0 +1,16 @@ +package gpgbin + +import ( + "io" +) + +// Import runs gpg --import and thus imports both private and public keys +func Import(r io.Reader) error { + args := []string{"--import"} + g := newGpg(r, args) + err := g.cmd.Run() + if err != nil { + return err + } + return nil +} |