ua_securechannel.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef UA_SECURECHANNEL_H_
  2. #define UA_SECURECHANNEL_H_
  3. #include "ua_types_generated.h"
  4. #include "ua_transport.h"
  5. #include "ua_transport_generated.h"
  6. #include "ua_connection.h"
  7. /**
  8. * @ingroup internal
  9. *
  10. * @defgroup securechannel SecureChannel
  11. */
  12. struct UA_Session;
  13. typedef struct UA_Session UA_Session;
  14. struct UA_SecureChannel {
  15. UA_MessageSecurityMode securityMode;
  16. UA_ChannelSecurityToken securityToken; // the channelId is contained in the securityToken
  17. UA_AsymmetricAlgorithmSecurityHeader clientAsymAlgSettings;
  18. UA_AsymmetricAlgorithmSecurityHeader serverAsymAlgSettings;
  19. UA_ByteString clientNonce;
  20. UA_ByteString serverNonce;
  21. UA_UInt32 requestId;
  22. UA_UInt32 sequenceNumber;
  23. UA_Connection *connection; // make this more generic when http connections exist
  24. UA_Session *session;
  25. };
  26. void UA_SecureChannel_init(UA_SecureChannel *channel);
  27. void UA_SecureChannel_deleteMembers(UA_SecureChannel *channel);
  28. void UA_SecureChannel_delete(UA_SecureChannel *channel);
  29. UA_Boolean UA_SecureChannel_compare(UA_SecureChannel *sc1, UA_SecureChannel *sc2);
  30. UA_StatusCode UA_SecureChannel_generateNonce(UA_ByteString *nonce);
  31. UA_Int32 UA_SecureChannel_updateRequestId(UA_SecureChannel *channel, UA_UInt32 requestId);
  32. UA_Int32 UA_SecureChannel_updateSequenceNumber(UA_SecureChannel *channel, UA_UInt32 sequenceNumber);
  33. #endif /* UA_SECURECHANNEL_H_ */