Documentation ¶
Overview ¶
Package key provides RSA Key API management for crypto/x509/rsa.
This package makes easy to generate Keys and load RSA from files to be used by GoLang applications.
Generating RSA Keys, the files will be saved in the $CAPATH by default. For $CAPATH, please check out the GoCA documentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPrivateKey ¶
func LoadPrivateKey(keyString []byte) (*rsa.PrivateKey, error)
LoadPrivateKey loads a RSA Private Key from a read file.
Using ioutil.ReadFile() satisfyies it.
Types ¶
type KeysData ¶
type KeysData struct { Key rsa.PrivateKey PublicKey rsa.PublicKey }
KeysData represents the RSA keys with Private Key (Key) and Public Key (Public Key).
func CreateKeys ¶
func CreateKeys(CACommonName, commonName string, creationType storage.CreationType, bitSize int) (KeysData, error)
CreateKeys creates RSA private and public keyData that contains Key and PublicKey.
The files are stored in the $CAPATH
Click to show internal directories.
Click to hide internal directories.