NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
asymmetric_crypto_key_interface.h
Go to the documentation of this file.
1 #ifndef SDK_CRYPT_ASYMMETRIC_CRYPTO_KEY_INTERFACE_H_
11 #define SDK_CRYPT_ASYMMETRIC_CRYPTO_KEY_INTERFACE_H_
12 
13 #include <base/inc/platform.h>
14 #include <base/inc/sdk_results.h>
15 #include <base/inc/sdk_ref_ptr.h>
18 #include <base/inc/forward_declarations.h>
20 
21 SDK_BEGIN_NAMESPACE
22 namespace crypt {
23 
24 typedef SDKArray PrivateKeyData;
25 typedef SDKArray PublicKeyData;
26 
27 FWD_DECL_INTERFACE(IPublicCryptoKey);
28 typedef IPublicCryptoKeySP PublicCryptoKeySP;
29 
30 FWD_DECL_INTERFACE(IPrivateCryptoKey);
31 typedef IPrivateCryptoKeySP PrivateCryptoKeySP;
32 
36 {
37  kPrivatePublicKeyType_Unknown = 0, // Unknown algorithm
38  kPrivatePublicKeyType_DSA512 = 1, // DSA512 private/public key
39  kPrivatePublicKeyType_DSA1024 = 2, // DSA1024 private/public key
40  kPrivatePublicKeyType_DSA2048 = 3, // DSA2048 private/public key
41 };
42 
46 {
47 public:
49  virtual PrivatePublicKeyType SDK_CALLTYPE GetPublicKeyType() const throw() = 0;
50 
53  virtual SDKResult SDK_CALLTYPE GetPublicKeyData(
54  PublicKeyData& public_key) const throw() = 0;
55 
57  SDK_IMPLEMENT_IID(IPublicCryptoKey)
58  SDK_END_INTERFACE(IPublicCryptoKey)
59 };
60 SDK_DECLARE_IID(IPublicCryptoKey)
61 
62 class IPrivateCryptoKey : public ICryptoKey
65 {
66 public:
68  virtual PrivatePublicKeyType SDK_CALLTYPE GetPrivateKeyType() const throw() = 0;
69 
72  virtual SDKResult SDK_CALLTYPE GetPrivateKeyData(
73  PrivateKeyData& private_key) const throw() = 0;
74 
76  SDK_IMPLEMENT_IID(IPrivateCryptoKey)
77  SDK_END_INTERFACE(IPrivateCryptoKey)
78 };
79 SDK_DECLARE_IID(IPrivateCryptoKey)
80 
81 } // namespace crypt
82 SDK_END_NAMESPACE
83 
84 #endif // SDK_CRYPT_ASYMMETRIC_CRYPTO_KEY_INTERFACE_H_
crypt::PrivatePublicKeyType
PrivatePublicKeyType
Private/Public key type.
Definition: asymmetric_crypto_key_interface.h:35
sdk_results.h
A list of SDK error/return results.
sdk_ref_ptr.h
Interfaces wrapper with reference count control.
crypt::IPrivateCryptoKey::GetPrivateKeyType
virtual PrivatePublicKeyType SDK_CALLTYPE GetPrivateKeyType() const =0
Returns private key type.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
crypt::IPrivateCryptoKey::GetPrivateKeyData
virtual SDKResult SDK_CALLTYPE GetPrivateKeyData(PrivateKeyData &private_key) const =0
Returns the private crypto-key data The key data format depends of the crypto-algorithms in use.
crypt::IPublicCryptoKey
Public crypto-key instance.
Definition: asymmetric_crypto_key_interface.h:45
sdk_component_interface.h
Common base SDK interfaces.
crypto_key_interface.h
Base cryptographic key interface.
crypt::IPublicCryptoKey::GetPublicKeyData
virtual SDKResult SDK_CALLTYPE GetPublicKeyData(PublicKeyData &public_key) const =0
Returns the public crypto-key data The key data format depends of the crypto-algorithms in use.
platform.h
Describes the platform constants.
crypt::IPublicCryptoKey::GetPublicKeyType
virtual PrivatePublicKeyType SDK_CALLTYPE GetPublicKeyType() const =0
Returns public key type.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.
crypt::IPrivateCryptoKey
Private crypto-key instance.
Definition: asymmetric_crypto_key_interface.h:64
crypt::ICryptoKey
Base cryptographic key interface.
Definition: crypto_key_interface.h:26
sdk_array_handler.h
Wrapper for handling the SDKArray instance.