Documentation ¶
Overview ¶
A module to help with cryptographic requirements like encryption and hashing
Index ¶
- func DecryptB64ToBytes(data string) (decryptedData []byte, err error)
- func DecryptB64ToBytesWithDataKey(data string, dataKey string, clientId string) (decryptedData []byte, err error)
- func DecryptB64ToString(data string) (decryptedString string, err error)
- func DecryptB64ToStringWithDataKey(data string, dataKey string, clientId string) (decryptedString string, err error)
- func DecryptBytes(cipherData []byte) (data []byte, err error)
- func DecryptBytesWithDataKey(cipherData []byte, dataKey string, clientId string) (data []byte, err error)
- func DecryptString(data []byte) (stringData string, err error)
- func DecryptStringWithDataKey(data []byte, dataKey string, clientId string) (stringData string, err error)
- func EncryptBytes(data []byte) (encryptedBytes []byte, err error)
- func EncryptBytesWithDataKey(data []byte, dataKey string, clientId string) (encryptedBytes []byte, err error)
- func EncryptString(data string) (byteData []byte, err error)
- func EncryptStringWithDataKey(data string, dataKey string, clientId string) (byteData []byte, err error)
- func EncryptToB64String(data string) (encryptedDataB64Str string, err error)
- func EncryptToB64StringWithDataKey(data string, dataKey string, clientId string) (encryptedDataB64Str string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptB64ToBytes ¶
Decrypt a base64-encoded encrypted string to unencrypted bytes
This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func and returns resultant byte array.
func DecryptB64ToBytesWithDataKey ¶
func DecryptB64ToBytesWithDataKey(data string, dataKey string, clientId string) (decryptedData []byte, err error)
Decrypt a base64-encoded encrypted string to unencrypted bytes
This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func and returns resultant byte array.
func DecryptB64ToString ¶
Decrypt a base64-encoded encrypted string to unencrypted string
This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func, converts the result into a string and returns resultant string. Note: Only use when string data was encrypted.
func DecryptB64ToStringWithDataKey ¶
func DecryptB64ToStringWithDataKey(data string, dataKey string, clientId string) (decryptedString string, err error)
Decrypt a base64-encoded encrypted string to unencrypted string
This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func, converts the result into a string and returns resultant string. Note: Only use when string data was encrypted.
func DecryptBytes ¶
Decrypt a byte array Deprecated - to be removed in future releases - use DecryptBytesWithDataKey instead
This function accepts an incoming byte array, decrypts it using AES-256 decryption and returns the result in bytes
func DecryptBytesWithDataKey ¶
func DecryptBytesWithDataKey(cipherData []byte, dataKey string, clientId string) (data []byte, err error)
Decrypt a byte array
This function accepts an incoming byte array, decrypts it using AES-256 decryption and returns the result in bytes
func DecryptString ¶
Decrypt a byte array
This function accepts an incoming byte array, decrypts it using AES-256 decryption, converts the result into a string and returns the string
func DecryptStringWithDataKey ¶
func DecryptStringWithDataKey(data []byte, dataKey string, clientId string) (stringData string, err error)
Decrypt a byte array
This function accepts an incoming byte array, decrypts it using AES-256 decryption, converts the result into a string and returns the string
func EncryptBytes ¶
Encrypt a byte array Deprecated - to be removed in future releases - use EncryptBytesWithDataKey instead
This function accepts an incoming byte array, encrypts it using AES-256 decryption and returns the result in bytes
func EncryptBytesWithDataKey ¶
func EncryptBytesWithDataKey(data []byte, dataKey string, clientId string) (encryptedBytes []byte, err error)
Encrypt a byte array
This function accepts an incoming byte array, encrypts it using AES-256 decryption and returns the result in bytes
func EncryptString ¶
Encrypt a byte array
This function accepts an incoming string, encrypts it using EncryptBytes func and returns the result in bytes
func EncryptStringWithDataKey ¶
func EncryptStringWithDataKey(data string, dataKey string, clientId string) (byteData []byte, err error)
Encrypt a byte array
This function accepts an incoming string, encrypts it using EncryptBytes func and returns the result in bytes.
func EncryptToB64String ¶
Encrypt a string
This function accepts an incoming string, encrypts it using EncryptBytes func, encodes the bytearray to base64 string and returns the resultant string
func EncryptToB64StringWithDataKey ¶
func EncryptToB64StringWithDataKey(data string, dataKey string, clientId string) (encryptedDataB64Str string, err error)
Encrypt a string
This function accepts an incoming string, encrypts it using EncryptBytes func, encodes the bytearray to base64 string and returns the resultant string.
Types ¶
This section is empty.