keyutil

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	X509CRLBlockType       = "X509 CRL"
	CertificateBlockType   = "CERTIFICATE"
	ECPrivateKeyBlockType  = "EC PRIVATE KEY"
	RSAPrivateKeyBlockType = "RSA PRIVATE KEY"
	PrivateKeyBlockType    = "PRIVATE KEY"
	PublicKeyBlockType     = "PUBLIC KEY"
	ECPublicKeyType        = "EC PUBLIC KEY"
)

Variables

This section is empty.

Functions

func DecryptPrivateKeyPEM added in v0.0.6

func DecryptPrivateKeyPEM(pemData []byte, password string) ([]byte, error)

func EncryptPKCS8PrivateKeyPEM added in v0.0.6

func EncryptPKCS8PrivateKeyPEM(pemData []byte, password string) ([]byte, error)

func GenerateECKeys

func GenerateECKeys() (crypto.PrivateKey, []byte, crypto.PublicKey, []byte, error)

func GenerateRSAKeys

func GenerateRSAKeys() (crypto.PrivateKey, []byte, crypto.PublicKey, []byte, error)

func GetHexFormatted

func GetHexFormatted(buf []byte, sep string) string

func KeysMatch

func KeysMatch(priv crypto.PrivateKey, pub crypto.PublicKey) bool

func MarshalPrivateKeyToPEM

func MarshalPrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error)

func MarshalPublicKeyToPEM

func MarshalPublicKeyToPEM(publicKey crypto.PublicKey) ([]byte, error)

func ParseCRLsPEM

func ParseCRLsPEM(pemCrls []byte) ([]*x509.RevocationList, error)

func ParseCertsPEM

func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error)

func ParsePrivateKeyPEM

func ParsePrivateKeyPEM(keyData []byte) (crypto.PrivateKey, error)

func ParsePublicKeysPEM

func ParsePublicKeysPEM(keyData []byte) ([]crypto.PublicKey, error)

func ReadPrivateKey

func ReadPrivateKey(r io.Reader) (crypto.PrivateKey, error)

func ReadPrivateKeyFile

func ReadPrivateKeyFile(filename string) (crypto.PrivateKey, error)

func ReadPublicKeyFile

func ReadPublicKeyFile(filename string) (crypto.PublicKey, error)

func ReadPublicKeys

func ReadPublicKeys(r io.Reader) ([]crypto.PublicKey, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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