keys

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRSAPrivateKeyToPEM

func EncodeRSAPrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte

EncodeRSAPrivateKeyToPEM encodes an RSA private key to PEM format

func EncodeRSAPublicKeyToPEM

func EncodeRSAPublicKeyToPEM(publicKey *rsa.PublicKey) ([]byte, error)

EncodeRSAPublicKeyToPEM encodes an RSA public key to PEM format

func ExportRSAPublicKeyToPEM

func ExportRSAPublicKeyToPEM(publicKey *rsa.PublicKey) ([]byte, error)

Export RSA public key to PEM format

func GenerateGPGKey

func GenerateGPGKey(keyPath string) error

func GenerateRSAKeyPair

func GenerateRSAKeyPair(vaultRoot string, cfg *config.VaultConfig) error

GenerateRSAKeyPair generates an RSA key pair and saves it to the specified directory

func GenerateTestRSAKeyPair

func GenerateTestRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

GenerateTestRSAKeyPair generates a key pair for testing purposes

func GetPublicKeyFingerprint

func GetPublicKeyFingerprint(publicKey *rsa.PublicKey) (string, error)

Get fingerprint for an RSA public key

func GetRSAPublicKeyFingerprint

func GetRSAPublicKeyFingerprint(publicKey *rsa.PublicKey) (string, error)

GetRSAPublicKeyFingerprint calculates the fingerprint for an RSA public key

func LoadRSAKeys

func LoadRSAKeys(vaultPath string, rsaConfig *config.RSAConfig) (*rsa.PrivateKey, *rsa.PublicKey, *config.RSAConfig, error)

LoadRSAKeys loads RSA keys from the specified paths

func ParseRSAPrivateKeyFromPEM

func ParseRSAPrivateKeyFromPEM(pemData []byte) (*rsa.PrivateKey, error)

ParseRSAPrivateKeyFromPEM parses an RSA private key from PEM format

func ParseRSAPublicKeyFromPEM

func ParseRSAPublicKeyFromPEM(pemData []byte) (*rsa.PublicKey, error)

ParseRSAPublicKeyFromPEM parses an RSA public key from PEM format

func ValidateRSAKeyPair

func ValidateRSAKeyPair(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) error

ValidateRSAKeyPair validates that the private and public keys form a valid pair

Types

This section is empty.

Jump to

Keyboard shortcuts

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