opcua_secureChannelLayer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. static const Int32 SL_HEADER_LENGTH = 0;
  11. typedef struct _SL_ChannelSecurityToken
  12. {
  13. UInt32 ChannelId;
  14. UInt32 TokenId;
  15. UA_DateTime CreatedAt;
  16. Int32 RevisedLifeTime;
  17. }SL_ChannelSecurityToken;
  18. typedef struct _SL_OpenSecureChannelResponse
  19. {
  20. UInt32 ServerProtocolVersion;
  21. SL_ChannelSecurityToken SecurityToken;
  22. UA_String ServerNonce;
  23. }SL_Response;
  24. typedef struct _SL_SecureConversationMessageHeader
  25. {
  26. UInt32 MessageType;
  27. Byte IsFinal;
  28. UInt32 MessageSize;
  29. UInt32 SecureChannelId;
  30. }SL_SecureConversationMessageHeader;
  31. typedef struct _SL_AsymmetricAlgorithmSecurityHeader
  32. {
  33. UA_String SecurityPolicyUri;
  34. UA_String SenderCertificate;
  35. UA_String ReceiverThumbprint;
  36. }SL_AsymmetricAlgorithmSecurityHeader;
  37. typedef struct _SL_SequenceHeader
  38. {
  39. UInt32 SequenceNumber;
  40. UInt32 RequestId;
  41. }SL_SequenceHeader;
  42. /*
  43. * optional, only if there is encryption present
  44. */
  45. typedef struct _SL_AsymmetricAlgorithmSecurityFooter
  46. {
  47. Byte PaddingSize;
  48. Byte *Padding;
  49. UInt32 SignatureSize;
  50. Byte *Signature;
  51. }SL_AsymmetricAlgorithmSecurityFooter;
  52. /*
  53. typedef struct _SL_ResponseHeader
  54. {
  55. UA_DateTime timestamp;
  56. IntegerId requestHandle;
  57. UA_StatusCode serviceResult;
  58. UA_DiagnosticInfo serviceDiagnostics;
  59. UA_String *stringTable;
  60. UInt32 stringTableLength;
  61. UA_ExtensionObject additionalHeader;
  62. }SL_ResponseHeader;
  63. */
  64. #endif /* OPCUA_SECURECHANNELLAYER_H_ */