Documentation ¶
Index ¶
- func B64DecodeKeyFile(path string) (string, error)
- func B64DecodeKeyString(key string) (string, error)
- func B64EncodeKeyFile(path string) (string, error)
- func B64EncodeKeyString(key string) string
- func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey, hash hash.Hash) ([]byte, error)
- func DecryptWithPublicKey(ciphertext []byte, pub *rsa.PublicKey, hash hash.Hash) ([]byte, error)
- func EncryptWithPrivateKey(msg []byte, priv *rsa.PrivateKey, hash hash.Hash) ([]byte, error)
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey, hash hash.Hash) ([]byte, error)
- func GeneratePairKeys(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) []byte
- func SignWithPrivateKey(msg []byte, priv *rsa.PrivateKey, hashOpt ...crypto.Hash) ([]byte, error)
- func SignWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)
- func VerifyWithPrivateKey(msg []byte, signature []byte, priv *rsa.PrivateKey) error
- func VerifyWithPublicKey(msg []byte, signature []byte, pub *rsa.PublicKey, hashOpt ...crypto.Hash) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func B64DecodeKeyFile ¶
Returns decoding of base64 encoded key from file
func B64DecodeKeyString ¶
Returns base64 encoded public key from string
func B64EncodeKeyFile ¶
Returns base64 encoded key from file
func B64EncodeKeyString ¶
Returns base64 encoded public key from string
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
Converts bytes to private key
func BytesToPublicKey ¶
Converts bytes to public key
func DecryptWithPrivateKey ¶
Decrypts data with private key
func DecryptWithPublicKey ¶
Decrypts data with private key
func EncryptWithPrivateKey ¶
Encrypts data with public key
func EncryptWithPublicKey ¶
Encrypts data with public key
func GeneratePairKeys ¶
Generates a new key pair (private and public)
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
Converts private key to bytes
func PublicKeyToBytes ¶
Converts public key to bytes
func SignWithPrivateKey ¶
Decrypts data with private key
func SignWithPublicKey ¶
Encrypts data with public key
func VerifyWithPrivateKey ¶
func VerifyWithPrivateKey(msg []byte, signature []byte, priv *rsa.PrivateKey) error
Decrypts data with private key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.