ua_securechannel.h 1.4 KB

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