RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
ICryptoProvider.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_CRYPTOPROVIDER_H_
10 #define _CRYPTO_STREAMS_LIB_CRYPTOPROVIDER_H_
11 #include <stdint.h>
12 #include <memory>
13 #include <vector>
14 
15 #include "CryptoAPIExport.h"
16 
17 namespace rmscrypto {
18 namespace api {
19 enum CipherMode
20 {
21  CIPHER_MODE_CBC4K,
22  CIPHER_MODE_ECB,
23  CIPHER_MODE_CBC512NOPADDING
24 };
25 
27 public:
28 
29  virtual void Encrypt(const uint8_t *pbIn,
30  uint32_t cbIn,
31  uint32_t dwStartingBlockNumber,
32  bool isFinal,
33  uint8_t *pbOut,
34  uint32_t cbOut,
35  uint32_t *pcbOut) = 0;
36  virtual void Decrypt(const uint8_t *pbIn,
37  uint32_t cbIn,
38  uint32_t dwStartingBlockNumber,
39  bool isFinal,
40  uint8_t *pbOut,
41  uint32_t cbOut,
42  uint32_t *pcbOut) = 0;
43 
44 
45  virtual uint64_t GetCipherTextSize(uint64_t clearTextSize)
46  = 0;
47 
48  virtual uint32_t GetBlockSize() = 0;
49  virtual std::vector<uint8_t>GetKey() = 0;
50 };
51 } // namespace api
52 } // namespace rmscrypto
53 #endif // _CRYPTO_STREAMS_LIB_CRYPTOPROVIDER_H_
Definition: BlockBasedProtectedStream.cpp:13
Definition: ICryptoProvider.h:26