public DownloadParameter Build() { return(new DownloadParameter( TransactionHash, AccountPrivateKey, PrivacyStrategy ?? PlainPrivacyStrategy.Create(), ValidateDigest ?? false)); }
public UploadParameter Build() { return(new UploadParameter(Data, SignerPrivateKey, RecipientPublicKey, RecipientAddress, ComputeDigest ?? false, DetectContentType ?? false, TransactionDeadline ?? 12, TransactionMosaics, UseBlockchainSecureMessage ?? false, PrivacyStrategy ?? PlainPrivacyStrategy.Create())); }
public DirectDownloadParameter Build() { return new DirectDownloadParameter( TransactionHash, AccountPrivateKey, DataHash, ValidateDigest, PrivacyStrategy ?? PlainPrivacyStrategy.Create(), Digest); }
public IObservable <Stream> GetByteStream(string dataHash, IPrivacyStrategy privacyStrategy, string digest) { CheckParameter(dataHash != null, "dataHash is required"); var privacyStrategyToUse = privacyStrategy ?? PlainPrivacyStrategy.Create(); ValidateDigest(digest, dataHash); return(FileRepository.GetByteStream(dataHash).Select(stream => privacyStrategyToUse.DecryptStream(stream))); }
public IObservable <FileUploadResponse> UploadByteStream(Func <Stream> byteStreamFunction, IPrivacyStrategy privacyStrategy, bool?computeDigest) { CheckParameter(byteStreamFunction != null, "byteStreamFunction is required"); var computeDigestToUse = computeDigest ?? false; var privacyStrategyToUse = privacyStrategy ?? PlainPrivacyStrategy.Create(); var digest = ComputeDigest(byteStreamFunction, privacyStrategyToUse, computeDigestToUse); var dataHashOb = FileRepository.AddByteStream(privacyStrategyToUse.EncryptStream(byteStreamFunction?.Invoke())); return(dataHashOb.Select(dataHash => new FileUploadResponse(dataHash, CurrentTimeMillis(), digest))); }
public UploadParameterBuilder WithPlainPrivacy() { PrivacyStrategy = PlainPrivacyStrategy.Create(); return(this); }
public DirectDownloadParameterBuilder WithPlainPrivacy() { PrivacyStrategy = PlainPrivacyStrategy.Create(); return this; }