rsaencryption

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: GPL-3.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertEncryptedPemToPrivateKey added in v1.1.0

func ConvertEncryptedPemToPrivateKey(pemData []byte, password string) (*rsa.PrivateKey, error)

ConvertEncryptedPemToPrivateKey return rsa private key from secret key

func ConvertPemToPrivateKey

func ConvertPemToPrivateKey(skPem string) (*rsa.PrivateKey, error)

ConvertPemToPrivateKey return rsa private key from secret key

func ConvertPemToPublicKey added in v1.1.0

func ConvertPemToPublicKey(pubPem []byte) (*rsa.PublicKey, error)

ConvertPemToPublicKey return rsa public key from public key pem

func DecodeKey

func DecodeKey(sk *rsa.PrivateKey, hash []byte) ([]byte, error)

DecodeKey with secret key (rsa) and hash (base64), return the decrypted key

func ExtractPrivateKey added in v1.1.0

func ExtractPrivateKey(sk *rsa.PrivateKey) string

ExtractPrivateKey gets private key and returns base64 encoded private key

func ExtractPublicKey

func ExtractPublicKey(sk *rsa.PrivateKey) (string, error)

ExtractPublicKey get public key from private key and return base64 encoded public key

func GenerateKeys

func GenerateKeys() ([]byte, []byte, error)

GenerateKeys using rsa random generate keys and return []byte bas64

func HashRsaKey added in v1.1.0

func HashRsaKey(keyBytes []byte) (string, error)

HashRsaKey return sha256 hash of rsa private key

func PrivateKeyToByte

func PrivateKeyToByte(sk *rsa.PrivateKey) []byte

PrivateKeyToByte converts privateKey to []byte

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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