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 ¶
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 ¶
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.