Open secure channel, if renew is True, renew channel
(self, renew=False)
| 320 | raise ack |
| 321 | |
| 322 | def open_secure_channel(self, renew=False): |
| 323 | """ |
| 324 | Open secure channel, if renew is True, renew channel |
| 325 | """ |
| 326 | params = ua.OpenSecureChannelParameters() |
| 327 | params.ClientProtocolVersion = 0 |
| 328 | params.RequestType = ua.SecurityTokenRequestType.Issue |
| 329 | if renew: |
| 330 | params.RequestType = ua.SecurityTokenRequestType.Renew |
| 331 | params.SecurityMode = self.security_policy.Mode |
| 332 | params.RequestedLifetime = self.secure_channel_timeout |
| 333 | # length should be equal to the length of key of symmetric encryption |
| 334 | params.ClientNonce = utils.create_nonce(self.security_policy.symmetric_key_size) # this nonce is used to create a symmetric key |
| 335 | result = self.uaclient.open_secure_channel(params) |
| 336 | if self.secure_channel_timeout != result.SecurityToken.RevisedLifetime: |
| 337 | _logger.warning("Requested secure channel timeout to be %dms, got %dms instead", |
| 338 | self.secure_channel_timeout, |
| 339 | result.SecurityToken.RevisedLifetime) |
| 340 | self.secure_channel_timeout = result.SecurityToken.RevisedLifetime |
| 341 | |
| 342 | def close_secure_channel(self): |
| 343 | return self.uaclient.close_secure_channel() |
no outgoing calls
no test coverage detected