I cannot seem to find help on the net with regards to this.
I have a JSON endpoint that the SQL developer has created and I'm required to POST the following JSON to receive my data.
{
"Command": "abc",
"Data": "base64(xData)",
"Signature" : "xyz"
}
Where xData is a JSON formatted data or RSA Encrypted JSON formatted data if a public key has been distributed. Signature is HashAlgorithm "SHA-256" in hex of the Base64(xdata)
I have learnt to encode base 64.
let combinedString = "sebastien"
let data = combinedString.data(using: .utf8)//Here combinedString is your string
let encodingString = data?.base64EncodedString()
print(encodingString!)
My questions are: - How do I add a SHA-256 signature on the base 64 xData? - How do I reverse the process and use the signature to confirm the xData is well received? - How do I de-encode base 64 xData?