gogpg

package module
v0.0.0-...-282112d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 5 Imported by: 1

README

gogpg

Simplified GPG encryption using golang

Generating GPG keys

  1. List all available keys

    gpg --list-keys
    
  2. Create a new key The adviced configuration is:

    Question Answer
    kind of key (1) RSA and RSA (default)
    keysize 4096
    *validity 0 = key does not expire (for staging)

    *validity should be specified for production.

    gpg --full-generate-key
    
  3. Export the keys

    gpg --armor --output <uid>.gpg.pub --export <uid>
    gpg --armor --output <uid>.gpg.pvt --export-secret-keys <uid>
    

Installation

import "github.com/reddotpay/gogpg"

Usage

func Decrypt
func Decrypt(secretkey io.Reader, passphrase string, text []byte) ([]byte, error)

Decrypt decrypts the message using secret key file and a passphrase

func Encrypt
func Encrypt(publickey io.Reader, text []byte) ([]byte, error)

Encrypt encrypts the message using the public key file

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(secretkey io.Reader, passphrase string, text []byte) ([]byte, error)

Decrypt decrypts the message using secret key file and a passphrase

func Encrypt

func Encrypt(publickey io.Reader, text []byte) ([]byte, error)

Encrypt encrypts the message using the public key file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL