ServerSecureChannelLayer Class
Constructor
ServerSecureChannelLayer
-
options
Parameters:
-
options
Object-
parent
OPCUAServerEndPointparent
-
[timeout= 30000]
Number optionaltimeout in milliseconds
-
[defaultSecureTokenLifetime= 30000]
optionaldefaultSecureTokenLifetime
-
[objectFactory]
optionalan factory that provides a method createObjectId(id) for the message builder
-
Item Index
Methods
- _check_receiverCertificateThumbprint verify that the receiverCertificateThumbprint send by the client matching the CertificateThumbPrint of the server
- _prepare_security_header
- _process_certificates
- _read_headers
- chunkSecureMessage
- close
- getCertificate
- getCertificate
- getPrivateKey
- init
- send_error_and_abort
- send_response
- update
Properties
Events
Methods
_check_receiverCertificateThumbprint
verify that the receiverCertificateThumbprint send by the client
matching the CertificateThumbPrint of the server
-
clientSecurityHeader
Parameters:
-
clientSecurityHeader
Object
Returns:
_prepare_security_header
-
request
-
message
Parameters:
-
request
Object -
message
Object
Returns:
_process_certificates
-
message
-
callback
_process_certificates extracts client public keys from client certificate and store them in self.receiverPublicKey and self.receiverCertificate it also caches self.receiverPublicKeyLength.
so they can be used by security channel.
Parameters:
-
message
Objectthe message coming from the client
-
callback
Object
_read_headers
-
binaryStream
Parameters:
-
binaryStream
Object
Returns:
chunkSecureMessage
-
msgType
-
options
-
message
-
messageChunkCallback
Parameters:
-
msgType
String -
options
Object-
tokenId
-
chunkSize
[default=8192]
-
signatureLength
Number[default=0]
-
signingFunc
Function[default=null]
-
-
message
Object -
messageChunkCallback
Function
close
-
callback
Abruptly close a Server SecureChannel ,by terminating the underlying transport.
Parameters:
-
callback
Function
getCertificate
()
Buffer
Returns:
the X509 DER form certificate
getCertificate
()
Buffer
Returns:
the X509 DER form certificate
getPrivateKey
()
Buffer
Returns:
the privateKey
init
-
socket
-
callback
Parameters:
-
socket
Socket -
callback
Function
send_error_and_abort
-
statusCode
-
description
-
message
-
callback
send a ServiceFault response
Parameters:
-
statusCode
StatusCodethe status code
-
description
String -
message
String -
callback
Function
send_response
-
msgType
-
response
-
message
-
[callback]
Parameters:
-
msgType
Object -
response
Object -
message
Object -
[callback]
Function optionalan optional callback function
update
-
options
Parameters:
-
options
Object-
securityHeader
ObjectSecurityHeader
-
[derivedKeys]
Object optionalderivedKeys
-
Properties
bytesRead
Number
the number of bytes read so far by this channel
bytesWritten
Number
the number of bytes written so far by this channel
hashKey
String
The unique hash key to identify this secure channel
hasSession
Boolean
true when the secure channel is assigned to a active session
isOpened
Boolean
true when the secure channel has been opened successfully
Events
abort
notify the observers that the SecureChannel has aborted. the reason could be :
- a CloseSecureChannelRequest has been received.
- a invalid message has been received the event is sent after the underlying transport layer has been closed.
invalid_sequence_number
Event Payload:
-
expected
Numbersequence Number -
actual
Numbersequence Number
message
notify the observer that a OPCUA message has been received. It is up to one observer to call send_response or send_error_and_abort to complete the transaction.
Event Payload:
-
message
Object