Skip to content

# Core.Crypt

Short: Keys, encrypt/decrypt, sign/verify.

## Overview

Simple wrappers around OpenPGP for common crypto tasks.

## Setup

    import (
      core "github.com/Snider/Core"
      crypt "github.com/Snider/Core/crypt"
    )

    app := core.New(
      core.WithService(crypt.Register),
      core.WithServiceLock(),
    )

## Use

- Generate keys
- Encrypt/decrypt data
- Sign/verify messages

## API

- `Register(c *core.Core) error`
- `GenerateKey(opts ...Option) (*Key, error)`
- `Encrypt(pub *Key, data []byte) ([]byte, error)`
- `Decrypt(priv *Key, data []byte) ([]byte, error)`
- `Sign(priv *Key, data []byte) ([]byte, error)`
- `Verify(pub *Key, data, sig []byte) error`

## Notes

- Uses ProtonMail OpenPGP fork.