我有要求-
我做完了-
现在-
请提出-
例如代码应该是-
//Client Code
function encrypt(originalData, certificate) {
let encryptedData = '';
/* this function to encrypt data using provided
certificate.
*/
return encryptedData;
}
function sendMessage(data) {
const certificate = /*read it from file System */;
const dataToBeSend = encrypt(data, certificate);
/*send the message to server using axios or
whatever means */
...
}
//Server Code
// i have basic nodejs server using express which has
//handler for post
function postHandler(req, res) {
const privateKey = /*read it from file System */;
const data = req.body;
??
const decriptedData = ??
...
}