ua_securechannel.h 1.6 KB

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