Documentation ¶
Index ¶
- Variables
- func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
- func BytesToPublicKey(pub []byte) *rsa.PublicKey
- func Decrypt(ciphered []byte, priv *rsa.PrivateKey) ([]byte, error)
- func DecryptAES(key, ciphered, iv []byte) (decoded []byte, err error)
- func DecryptMessage(Key, IV, Data string) (string, error)
- func Encrypt(data []byte, pub *rsa.PublicKey) ([]byte, error)
- func EncryptAES(key []byte, data []byte) (ciphered, nonce []byte)
- func GenerateKeys()
- func InitCert()
- func RsaPublicKeyByModulusAndExponent(nStr string, eStr string) *rsa.PublicKey
- func Test()
- type EncryptedMessage
- type JWKkey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PrivateKey *rsa.PrivateKey EncodedPublicKey []byte JWKPublicKey JWKkey )
View Source
var (
Cert *tls.Certificate = nil
)
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
func BytesToPublicKey ¶
func DecryptAES ¶
func DecryptMessage ¶
func EncryptAES ¶
func GenerateKeys ¶
func GenerateKeys()
Types ¶
type EncryptedMessage ¶
type EncryptedMessage struct { Data string `json:"Data"` Key string `json:"Key"` IV string `json:"IV"` }
func EncryptMessage ¶
func EncryptMessage(data []byte, key *rsa.PublicKey) (answer EncryptedMessage, err error)
Click to show internal directories.
Click to hide internal directories.