NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
base_cryptor_interface.h
1 #ifndef SDK_CRYPT_BASE_CRYPTOR_INTERFACE_H_
11 #define SDK_CRYPT_BASE_CRYPTOR_INTERFACE_H_
12 
13 #include <base/inc/platform.h>
14 #include <base/inc/sdk_results.h>
15 #include <base/inc/sdk_ref_ptr.h>
17 #include <base/inc/forward_declarations.h>
21 
22 SDK_BEGIN_NAMESPACE
23 namespace crypt {
24 
25 // Classes declared in this file.
26 FWD_DECL_INTERFACE(IBaseCryptor);
27 typedef IBaseCryptorSP BaseCryptorSP;
28 typedef IBaseCryptorSCP BaseCryptorSCP;
29 
34 static const wchar_t kBaseCryptorProp_PaddingType[] =
35  L"BaseCryptorProp_PaddingType";
36 
39 typedef enum PaddingType
40 {
44 } PaddingType;
45 
48 class IBaseCryptor : public ISDKNamedProperties
49 {
50  public:
53  virtual SDKResult SDK_CALLTYPE Encrypt(const CryptoKeySP& crypto_key,
54  const base::SDKStreamSP& in_stream,
55  const base::SDKStreamSP& out_stream) const throw() = 0;
56 
59  virtual SDKResult SDK_CALLTYPE Decrypt(const CryptoKeySP& crypto_key,
60  const base::SDKStreamSP& in_stream,
61  const base::SDKStreamSP& out_stream) const throw() = 0;
62 
64  //virtual SDKResult SDK_CALLTYPE SetProperty(const SDKString& id, const SDKAny& value) throw() = 0;
65  //virtual SDKResult SDK_CALLTYPE GetProperty(const SDKString& id, SDKAny& value) const throw() = 0;
66 
68  SDK_IMPLEMENT_IID(IBaseCryptor)
69  SDK_END_INTERFACE(IBaseCryptor)
70 };
71 SDK_DECLARE_IID(IBaseCryptor)
72 
73 } // namespace crypt
74 SDK_END_NAMESPACE
75 
76 #endif // SDK_CRYPT_BASE_CRYPTOR_INTERFACE_H_
crypt::IBaseCryptor::Decrypt
virtual SDKResult SDK_CALLTYPE Decrypt(const CryptoKeySP &crypto_key, const base::SDKStreamSP &in_stream, const base::SDKStreamSP &out_stream) const =0
Decrypts the data from stream by using crypto key and writes the given data to output stream.
sdk_results.h
A list of SDK error/return results.
sdk_ref_ptr.h
Interfaces wrapper with reference count control.
crypt::kPaddingType_None
@ kPaddingType_None
Padding is disabled.
Definition: base_cryptor_interface.h:41
crypt::kPaddingType_PKCS7
@ kPaddingType_PKCS7
PKCS7 padding type.
Definition: base_cryptor_interface.h:43
crypt::PaddingType
PaddingType
Possible value for kBaseCryptorProp_PaddingType property.
Definition: base_cryptor_interface.h:39
crypt::kPaddingType_Zeroes
@ kPaddingType_Zeroes
Zeroes will be used as padding pattern.
Definition: base_cryptor_interface.h:42
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
stream_interface.h
Generic data stream interface.
sdk_component_interface.h
Common base SDK interfaces.
crypto_key_interface.h
Base cryptographic key interface.
crypt::IBaseCryptor
Base cryptor interface, for encryption/decryption implementation.
Definition: base_cryptor_interface.h:48
platform.h
Describes the platform constants.
crypt::kBaseCryptorProp_PaddingType
static const wchar_t kBaseCryptorProp_PaddingType[]
Set of property names for cryptors.
Definition: base_cryptor_interface.h:34
named_properties_interface.h
Object generic named properties interface.
crypt::IBaseCryptor::Encrypt
virtual SDKResult SDK_CALLTYPE Encrypt(const CryptoKeySP &crypto_key, const base::SDKStreamSP &in_stream, const base::SDKStreamSP &out_stream) const =0
Encrypts the data from stream by using crypto key and writes the given data to output stream.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.