key

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package key handles the generation and other actions regarding RSA keypairs. These are required for signing of requests on behalf of users, and one will exist for every user in the system.

This is essentially listed wholesale from go-fed/apcore: https://github.com/go-fed/apcore/blob/master/keys.go

Index

Constants

View Source
const (
	// KeySize is the size of the keypair to use.
	KeySize = 1024
)

Variables

This section is empty.

Functions

func DeserializeRSAPrivateKey

func DeserializeRSAPrivateKey(b []byte) (crypto.PrivateKey, error)

DeserializeRSAPrivateKey takes byte representation of a private key and returns its PrivateKey representation.

func MarshalPublicKey

func MarshalPublicKey(p crypto.PublicKey) (string, error)

MarshalPublicKey takes a public key and returns its string representation.

func New

func New() (k *rsa.PrivateKey, err error)

New creates an RSA private key with the default size.

func NewOfSize

func NewOfSize(n int) (k *rsa.PrivateKey, err error)

NewOfSIze creates an RSA private key of a specified size.

func SerializeRSAPrivateKey

func SerializeRSAPrivateKey(k *rsa.PrivateKey) ([]byte, error)

SerializeRSAPrivateKey takes a private key and returns its byte representation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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