crypto

package
v0.0.0-...-a29219d Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ECPrivateKeyBlockType is a possible value for pem.Block.Type.
	ECPrivateKeyBlockType = "EC PRIVATE KEY"
	// RSAPrivateKeyBlockType is a possible value for pem.Block.Type.
	RSAPrivateKeyBlockType = "RSA PRIVATE KEY"
	// PrivateKeyBlockType is a possible value for pem.Block.Type.
	PrivateKeyBlockType = "PRIVATE KEY"
)

Variables

This section is empty.

Functions

func GenerateECKey

func GenerateECKey(curve string) (ecKey *ecdsa.PrivateKey, err error)

func GenerateRSAKey

func GenerateRSAKey(bitLength int) (rsaKey *rsa.PrivateKey, err error)

func GetMaxRSAKeyLengthBits

func GetMaxRSAKeyLengthBits() int

func GetSupportedECCurves

func GetSupportedECCurves() map[string]elliptic.Curve

func ParsePrivateKeyPEM

func ParsePrivateKeyPEM(keyData []byte) (interface{}, error)

ParsePrivateKeyPEM returns a private key parsed from a PEM block in the supplied data. Recognizes PEM blocks for "EC PRIVATE KEY", "RSA PRIVATE KEY", or "PRIVATE KEY"

Types

This section is empty.

Jump to

Keyboard shortcuts

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