crypto

package
v0.0.0-...-d0cb44a Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RotateKeys

func RotateKeys(km *KeyManager, interval time.Duration) error

Types

type KeyManager

type KeyManager struct {
	// contains filtered or unexported fields
}

func NewKeyManager

func NewKeyManager() *KeyManager

func (*KeyManager) DecryptAESKey

func (km *KeyManager) DecryptAESKey(privKey *rsa.PrivateKey, encryptedKey []byte) ([]byte, error)

func (*KeyManager) DecryptData

func (km *KeyManager) DecryptData(encrypted, aesKey []byte) ([]byte, error)

func (*KeyManager) EncryptAESKey

func (km *KeyManager) EncryptAESKey(pubKey *rsa.PublicKey, aesKey []byte) ([]byte, error)

func (*KeyManager) EncryptData

func (km *KeyManager) EncryptData(data, aesKey []byte) ([]byte, error)

func (*KeyManager) GetPrivateKey

func (km *KeyManager) GetPrivateKey() *rsa.PrivateKey

func (*KeyManager) GetPublicKey

func (km *KeyManager) GetPublicKey() *rsa.PublicKey

func (*KeyManager) SetKeys

func (km *KeyManager) SetKeys(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey)

Jump to

Keyboard shortcuts

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