public Task Upload(Signature targetSignature, CommentContent comment, AgreementPublicKey agreementPublicKey, DigitalSignature digitalSignature, CancellationToken token) { if (targetSignature == null) { throw new ArgumentNullException(nameof(targetSignature)); } if (comment == null) { throw new ArgumentNullException(nameof(comment)); } if (digitalSignature == null) { throw new ArgumentNullException(nameof(digitalSignature)); } return(_coreManager.VolatileSetStream(ContentConverter.ToCryptoStream(comment, 1024 * 256, agreementPublicKey, 0), TimeSpan.FromDays(360), token) .ContinueWith(task => { _coreManager.UploadMetadata(new UnicastClue("MailMessage", targetSignature, DateTime.UtcNow, task.Result, digitalSignature)); })); }
public static Stream ToCryptoStream <T>(T message, int paddingSize, AgreementPublicKey publicKey, int version) where T : MessageBase <T> { if (message == null) { throw new ArgumentNullException(nameof(message)); } if (publicKey == null) { throw new ArgumentNullException(nameof(publicKey)); } try { throw new NotImplementedException(); //return AddVersion(AddHash(Encrypt(AddPadding(Compress(message.Export(_bufferManager)), paddingSize), publicKey)), version); } catch (Exception e) { Log.Debug(e); return(null); } }
public Task SetUnicastCommentMessage(Signature targetSignature, CommentContent comment, AgreementPublicKey agreementPublicKey, DigitalSignature digitalSignature, CancellationToken token) { this.Check(); lock (_lockObject) { return(Task.Run(() => { this.Action(AmoebaFunctionType.SetUnicastCommentMessage, (targetSignature, comment, agreementPublicKey, digitalSignature), token); })); } }
public Task SetUnicastCommentMessage(Signature targetSignature, CommentContent comment, AgreementPublicKey agreementPublicKey, DigitalSignature digitalSignature, CancellationToken token) { this.Check(); lock (_lockObject) { return(_messageManager.Upload(targetSignature, comment, agreementPublicKey, digitalSignature, token)); } }