Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SHA256Hash ¶
SHA256Hash computes SHA256 hash of data and returns hash in []byte format.
func SHA256ToBase64 ¶
SHA256ToBase64 encoded hashed value to base64 format.
func Sign ¶
Sign calculated the RSA signature of hashed value using RSA private key.
To generate hash you can use generate.SHA256Hash function.
func VerifySignature ¶
func VerifySignature(publicKey *rsa.PublicKey, hash crypto.Hash, hashed []byte, signature []byte) bool
VerifySignature verifies the RSA signature using RSA public key and hashed value. Note that you should calculate hash again in order to prevent any modification in transport (MITM attack).
To generate hash you can use generate.SHA256Hash function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.