Esempio n. 1
0
        public string EncriptItemForShare(Share share, string receiverPublicKey)
        {
            string    payloadPlain  = share.GetShareJson();
            string    encriptionKey = String.Empty;
            AESKeySet keySet        = null;
            string    payload       = pbData.EcryptAndSignWithAES(payloadPlain, out keySet);//.EncriptWithAES(payloadPlain, out encriptionKey);

            encriptionKey = pbData.EncriptWithRSA(receiverPublicKey, keySet.KeysToString());
            return(JsonConvert.SerializeObject(new { key = encriptionKey, payload = payload }, Formatting.None, new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }