key

package
v0.0.0-...-0d802d7 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 5 Imported by: 0

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.

func LoadPublicKey

func LoadPublicKey(keyString []byte) (*rsa.PublicKey, error)

LoadPublicKey loads a RSA Public 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

Jump to

Keyboard shortcuts

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