Module opcua_server::prelude
source · [−]Expand description
Provides a way to use most types and functions commonly used by server implementations from a single use statement.
Re-exports
pub use crate::address_space::types::*;
pub use crate::address_space::AccessLevel;
pub use crate::address_space::EventNotifier;
pub use crate::address_space::UserAccessLevel;
pub use crate::builder::*;
pub use crate::callbacks::*;
pub use crate::config::*;
pub use crate::events::event::*;
pub use crate::historical::*;
pub use crate::server::*;
pub use crate::subscriptions::*;
pub use crate::util::*;
Modules
Symmetric encryption / decryption wrapper.
Contains definitions of the simple OPC UA scalar types.
Contains the implementation of ByteString
.
The certificate store holds and retrieves private keys and certificates from disk. It is responsible for checking certificates supplied by the remote end to see if they are valid and trusted or not.
Contains the implementation of DataValue
.
Contains the implementation of DataTime
.
Contains the implementation of DiagnosticInfo
.
Contains the BinaryEncoder
trait and helpers for reading and writing of scalar values and
other primitives.
Contains the implementation of ExtensionObject
.
Contains the implementation of Guid
.
Hashing functions used for producing and verifying digital signatures
Contains the definition of LocalizedText
.
Contains the implementation of NodeId
and ExpandedNodeId
.
Contains the implementation of NumericRange
.
Asymmetric encryption / decryption, signing / verification wrapper.
Contains constants recognized by OPC UA clients and servers to describe various protocols and profiles used during communication and encryption.
Contains the definition of QualifiedName
.
Module contains functions for creating cryptographically strong random bytes.
Contains functions used for making relative paths from / to strings, as per OPC UA Part 4, Appendix A
Security policy is the symmetric, asymmetric encryption / decryption + signing / verification algorithms to use and enforce for the current session.
Contains the hand implemented part of the StatusCode type. The other file, status_codes.rs
contains
the machine generated part.
Contains the implementation of UAString
.
Functionality for holding a message digest.
Functions related to encrypting / decrypting passwords in a UserNameIdentityToken.
Contains the implementation of Variant
.
Structs
Implementation of the ACK message in OPC UA
An array is a vector of values with an optional number of dimensions. It is expected that the multi-dimensional array is valid, or it might not be encoded or decoded properly. The dimensions should match the number of values, or the array is invalid.
A sequence of octets.
The certificate store manages the storage of a server/client’s own certificate & private key and the trust / rejection of certificates from the other end.
The Chunker is responsible for turning messages to chunks and chunks into messages.
This is a convenience for building ContentFilter
using operands as building blocks
This builder does not check to see that the content filter is valid, i.e. if you
reference an element by index that doesn’t exist, or introduce a loop then you will
not get an error until you feed it to a server and the server rejects it or breaks.
A data value is a value of a variable in the OPC UA server and contains information about its value, status and change timestamps.
A date/time value. This is a wrapper around the chrono type with extra functionality for obtaining ticks in OPC UA measurements, endtimes, epoch etc.
Diagnostic information.
Implementation of the ERR message in OPC UA
A NodeId that allows the namespace URI to be specified instead of an index.
An extension object holds a serialized object identified by its node id.
A Guid is a 16 byte Globally Unique Identifier.
Implementation of the HEL message in OPC UA
A human readable text with an optional locale identifier.
A chunk holds a message or a portion of a message, if the message has been split into multiple chunks. The chunk’s data may be signed and encrypted. To extract the message requires all the chunks to be available in sequence so they can be formed back into the message.
An identifier for a node in the address space of an OPC UA Server.
This is a wrapper around an OpenSSL
asymmetric key pair. Since openssl 0.10, the PKey is either
a public or private key so we have to differentiate that as well.
An identifier for a error or condition that is associated with a value or an operation.
The RequestHeader
contains information common to every request from a client to the server.
The ResponseHeader
contains information common to every response from server to client.
Holds all of the security information related to this session
Implements a tokio codec that as close as possible, allows incoming data to be transformed into OPC UA message chunks with no intermediate buffers. Chunks are subsequently transformed into messages so there is still some buffers within message chunks, but not at the raw socket level.
The thumbprint holds a 20 byte representation of a certificate that can be used as a hash, handshake comparison, a filename hint or similar purpose where a shortened representation of a cert is required. Thumbprint size is dictated by the OPC UA spec
To avoid naming conflict hell, the OPC UA String type is typed UAString
so it does not collide
with the Rust String
.
This is a wrapper around the OpenSSL
X509
cert
Used to create an X509 cert (and private key)
Enums
Enumeration that holds the kinds of encoding that an ExtensionObject data may be encoded with.
The kind of identifier, numeric, string, guid or byte
The possible encodings for a NodeId value.
Numeric range describes a range within an array. See OPCUA Part 4 7.22
Holds the security header associated with the chunk. Secure channel requests use an asymmetric security header, regular messages use a symmetric security header.
SecurityPolicy implies what encryption and signing algorithms and their relevant key strengths are used during an encrypted session.
A Variant
holds built-in OPC UA data types, including single and multi dimensional arrays,
data values and extension objects.
The variant type id is the type of the variant but without its payload.
Constants
The size of a chunk header, used by several places
Size in bytes of an OPC UA message header
Minimum size in bytes than any single message chunk can be
Traits
OPC UA Binary Encoding interface. Anything that encodes to binary must implement this. It provides functions to calculate the size in bytes of the struct (for allocating memory), encoding to a stream and decoding from a stream.
A trait that handles the loading / saving and validity of configuration information for a client and/or server.
Implemented by messages
Functions
Calculates the length in bytes of an array of encoded type
Creates a SignatureData
object by signing the supplied certificate and nonce with a pkey
Decrypt the password inside of a user identity token.
Returns this computer’s hostname
Decrypt the client’s password using the server’s nonce and private key. This function is prefixed “legacy” because 1.04 describes another way of encrypting passwords.
Encrypt a client side user’s password using the server nonce and cert. This is described in table 176 OPC UA part 4. This function is prefixed “legacy” because 1.04 describes another way of encrypting passwords.
Create a filled in UserNameIdentityToken by using the supplied channel security policy, user token policy, nonce, cert, user name and password.
Pseudo random P_SHA
implementation for creating pseudo random range of bytes from an input
Converts an IO encoding error (and logs when in error) into an EncodingResult
Converts an IO encoding error (and logs when in error) into an EncodingResult
Reads an array of the encoded type from a stream, preserving distinction between null array and empty array
Reads an array of bytes from the stream
Read a 32-bit precision value from the stream
Read a 64-bit precision from the stream
Read an signed 16-bit value from the stream
Read a signed 32-bit value from the stream
Read a signed 64-bit value from the stream
Read an unsigned byte from the stream
Read an unsigned 16-bit value from the stream
Read an unsigned 32-bit value from the stream
Read an unsigned 64-bit value from the stream
Takes an endpoint url and strips off the path and args to leave just the protocol, host & port.
Test if the two urls match except for the hostname. Can be used by a server whose endpoint doesn’t exactly match the incoming connection, e.g. 127.0.0.1 vs localhost.
Replace the hostname in the supplied url and return a new url
Check that all elements in the slice of arrays are the same type.
Verify that the HMAC for the data block matches the supplied signature
Verify that the HMAC for the data block matches the supplied signature
Verifies that the supplied signature data was produced by the signing cert. The contained cert and nonce are supplied so the signature can be verified against the expected data.
Verify that the X509 identity token supplied to a server contains a valid signature.
Write an array of the encoded type to stream, preserving distinction between null array and empty array
Writes a series of identical bytes to the stream
Writes a 32-bit precision value to the stream
Writes a 64-bit precision value to the stream
Writes a signed 16-bit value to the stream
Writes a signed 32-bit value to the stream
Writes a signed 64-bit value to the stream
Writes an unsigned byte to the stream
Writes an unsigned 16-bit value to the stream
Writes an unsigned 32-bit value to the stream
Writes an unsigned 64-bit value to the stream
Type Definitions
This Simple DataType is a Double that defines an interval of time in milliseconds (fractions can be used to define sub-millisecond values). Negative values are generally invalid but may have special meanings where the Duration is used. Duration = 290,
This primitive data type is a UInt32 that is used as an identifier, such as a handle. All values, except for 0, are valid. IntegerId = 288,
A public key
UtcTime = 294,
An XML element.