RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
ICryptoStream.h
1 /*
2  * ======================================================================
3  * Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4  * Licensed under the MIT License.
5  * See LICENSE.md in the project root for license information.
6  * ======================================================================
7  */
8 
9 #ifndef _CRYPTO_STREAMS_LIB_SECRETSTREAM_H_
10 #define _CRYPTO_STREAMS_LIB_SECRETSTREAM_H_
11 #include <stdint.h>
12 #include "IStream.h"
13 #include "CryptoAPI.h"
14 
15 namespace rmscrypto {
16 namespace api {
17 class ICryptoStream : public IStream {
18 public:
19 
20  virtual std::shared_future<int64_t>ReadAsync(uint8_t *pbBuffer,
21  int64_t cbBuffer,
22  int64_t cbOffset,
23  std::launch launchType)
24  override;
25  virtual std::shared_future<int64_t>WriteAsync(const uint8_t *cpbBuffer,
26  int64_t cbBuffer,
27  int64_t cbOffset,
28  std::launch launchType)
29  override;
30  virtual std::future<bool>FlushAsync(std::launch launchType) override;
31 
32  // Sync methods
33  virtual int64_t Read(uint8_t *pbBuffer,
34  int64_t cbBuffer) override;
35  virtual int64_t Write(const uint8_t *cpbBuffer,
36  int64_t cbBuffer) override;
37  virtual bool Flush() override;
38 
39  virtual SharedStream Clone() = 0;
40 
41  virtual void Seek(uint64_t u64Position) override;
42  virtual bool CanRead() const override;
43  virtual bool CanWrite() const override;
44  virtual uint64_t Position() override;
45  virtual uint64_t Size() override;
46  virtual void Size(uint64_t u64Value) override;
47 };
48 } // namespace api
49 } // namespace rmscrypto
50 #endif // ifndef _CRYPTO_STREAMS_LIB_SECRETSTREAM_H_
Definition: BlockBasedProtectedStream.cpp:13
Base interface for protected streams.
Definition: IStream.h:34
Definition: ICryptoStream.h:17