Documentation ¶
Index ¶
- func Base64ToPrivateKey(b64Key string) (*rsa.PrivateKey, error)
- func Base64ToPublicKey(b64Key string) (*rsa.PublicKey, error)
- func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func DecryptWithPrivateKey(privateKey *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func EncryptWithPublicKey(publicKey *rsa.PublicKey, text []byte) ([]byte, error)
- func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string
- func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) string
- func GenerateNonce() (string, error)
- func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)
- func ParseRsaPublicKeyFromPemStr(pubPEM string) (*rsa.PublicKey, error)
- func PrivateKeyToBase64(key *rsa.PrivateKey) string
- func PublicKeyToBase64(key *rsa.PublicKey) string
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64ToPrivateKey ¶
func Base64ToPrivateKey(b64Key string) (*rsa.PrivateKey, error)
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(privateKey *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
func EncryptWithPublicKey ¶
func ExportRsaPrivateKeyAsPemStr ¶
func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string
func GenerateNonce ¶
func ParseRsaPrivateKeyFromPemStr ¶
func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)
func PrivateKeyToBase64 ¶
func PrivateKeyToBase64(key *rsa.PrivateKey) string
func PublicKeyToBase64 ¶
Types ¶
type KeyPair ¶
type KeyPair struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey }
func GenerateKeyPair ¶
Click to show internal directories.
Click to hide internal directories.