opcua_secureChannelLayer.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * opcua_secureChannelLayer.h
  3. *
  4. * Created on: Dec 19, 2013
  5. * Author: opcua
  6. */
  7. #ifndef OPCUA_SECURECHANNELLAYER_H_
  8. #define OPCUA_SECURECHANNELLAYER_H_
  9. #include "opcua_advancedDatatypes.h"
  10. #include "opcua_encodingLayer.h"
  11. static const Int32 SL_HEADER_LENGTH = 0;
  12. typedef struct _SL_ChannelSecurityToken
  13. {
  14. UInt32 ChannelId;
  15. UInt32 TokenId;
  16. UA_DateTime CreatedAt;
  17. Int32 RevisedLifeTime;
  18. }SL_ChannelSecurityToken;
  19. typedef struct _SL_OpenSecureChannelResponse
  20. {
  21. UInt32 ServerProtocolVersion;
  22. SL_ChannelSecurityToken SecurityToken;
  23. UA_String ServerNonce;
  24. }SL_Response;
  25. typedef struct _SL_SecureConversationMessageHeader
  26. {
  27. UInt32 MessageType;
  28. Byte IsFinal;
  29. UInt32 MessageSize;
  30. UInt32 SecureChannelId;
  31. }SL_SecureConversationMessageHeader;
  32. typedef struct _SL_AsymmetricAlgorithmSecurityHeader
  33. {
  34. UA_String SecurityPolicyUri;
  35. UA_String SenderCertificate;
  36. UA_String ReceiverThumbprint;
  37. }SL_AsymmetricAlgorithmSecurityHeader;
  38. typedef struct _SL_SequenceHeader
  39. {
  40. UInt32 SequenceNumber;
  41. UInt32 RequestId;
  42. }SL_SequenceHeader;
  43. /*
  44. * optional, only if there is encryption present
  45. */
  46. typedef struct _SL_AsymmetricAlgorithmSecurityFooter
  47. {
  48. Byte PaddingSize;
  49. Byte *Padding;
  50. UInt32 SignatureSize;
  51. Byte *Signature;
  52. }SL_AsymmetricAlgorithmSecurityFooter;
  53. /*
  54. typedef struct _SL_ResponseHeader
  55. {
  56. UA_DateTime timestamp;
  57. IntegerId requestHandle;
  58. UA_StatusCode serviceResult;
  59. UA_DiagnosticInfo serviceDiagnostics;
  60. UA_String *stringTable;
  61. UInt32 stringTableLength;
  62. UA_ExtensionObject additionalHeader;
  63. }SL_ResponseHeader;
  64. */
  65. #endif /* OPCUA_SECURECHANNELLAYER_H_ */