.NET Based OPC UA Client/Server SDK  3.3.3.537
UnifiedAutomation.UaServer.TrustListModel Class Reference

An object which represents a trust list. More...

Inherits UnifiedAutomation.UaServer.FileModel, UnifiedAutomation.UaServer.IMethodDispatcher, and UnifiedAutomation.UaServer.ITrustListMethods.

Public Member Functions

override StatusCode Open (RequestContext context, FileModel model, byte mode, out uint fileHandle)
 Opens the specified context. More...
 
virtual StatusCode OpenWithMasks (RequestContext context, TrustListModel model, uint masks, out uint fileHandle)
 Allows a Client to read only a portion of the trust list. More...
 
virtual StatusCode CloseAndUpdate (RequestContext context, TrustListModel model, uint fileHandle, out bool restartRequired)
 Closes the file and applies the changes to the trust list. More...
 
StatusCode AddCertificate (RequestContext context, TrustListModel model, byte[] certificate, bool isTrustedCertificate)
 Allows a Client to add a single certificate to the trust list. More...
 
StatusCode RemoveCertificate (RequestContext context, TrustListModel model, string thumbprint, bool isTrustedCertificate)
 Allows a Client to remove a single certificate from the trust list. More...
 
 TrustListModel ()
 Initializes a new instance of the TrustListModel class. More...
 
 TrustListModel (TrustListModel template, DummyArgument dummy=null)
 Initializes a new instance of the TrustListModel class. More...
 
override CallMethodEventHandler GetMethodDispatcher (RequestContext context, NodeId objectId, NodeId methodId)
 Gets the method dispatcher. More...
 
override StatusCode DispatchMethod (RequestContext context, MethodHandle methodHandle, IList< Variant > inputArguments, List< StatusCode > inputArgumentResults, List< Variant > outputArguments)
 Dispatches the method. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.FileModel
void Dispose ()
 Frees any unmanaged resources. More...
 
virtual StatusCode Close (RequestContext context, FileModel model, uint fileHandle)
 Closes a file represented by a FileType. More...
 
virtual StatusCode Read (RequestContext context, FileModel model, uint fileHandle, int length, out byte[] data)
 Reads a part of the file starting from the current file position. More...
 
virtual StatusCode Write (RequestContext context, FileModel model, uint fileHandle, byte[] data)
 Writes a part of the file starting from the current file position. More...
 
virtual StatusCode SetPosition (RequestContext context, FileModel model, uint fileHandle, ulong position)
 Used to set the current position of the FileHandle. More...
 
virtual StatusCode GetPosition (RequestContext context, FileModel model, uint fileHandle, out ulong position)
 Provides the current position of the FileHandle. More...
 
 FileModel ()
 Initializes a new instance of the FileModel class. More...
 
 FileModel (FileModel template, DummyArgument dummy=null)
 Initializes a new instance of the FileModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.BaseObjectModel
 BaseObjectModel ()
 Initializes a new instance of the BaseObjectModel class. More...
 
 BaseObjectModel (BaseObjectModel template, DummyArgument dummy=null)
 Initializes a new instance of the BaseObjectModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.ModelControllerBase
virtual ModelHandle GetModelHandle (StringTable namespaceUris, object instance)
 Gets the metadata handle. More...
 
virtual DataValue GetValue (IMapperContext context, ModelMapping mapping)
 Gets the value associated with the mapping. More...
 
virtual bool SetValue (IMapperContext context, ModelMapping mapping, DataValue value)
 Sets the value associated with the mapping. More...
 
StatusCode GetStatusCode (string propertyName)
 Retrieve the status code for the given property. If no status code was explicitly set, StatusCodes.Good will be returned.
Parameters
propertyNameThe property name.
Returns
The status code of the property.

 
void SetStatusCode (string propertyName, StatusCode statusCode)
 Sets the status code of the given property. More...
 

Properties

string StorePath [get, set]
 Gets or sets the store path. More...
 
double ActivityTimeout [get, set]
 Gets or sets the ActivityTimeout More...
 
TrustListValidationOptions DefaultValidationOptions [get, set]
 Gets or sets the DefaultValidationOptions More...
 
DateTime LastUpdateTime [get, set]
 Indicates when the trust list was last updated via trust list object methods. More...
 
double UpdateFrequency [get, set]
 Gets or sets the UpdateFrequency More...
 
- Properties inherited from UnifiedAutomation.UaServer.FileModel
FileInfo FileOnDisk [get, set]
 Gets or sets the disk file which can be accessed via the file object. More...
 
int MaxFileSize [get, set]
 Gets or sets the maximum size of the file in bytes. More...
 
INodeAccessInfo NodeAccessInfo [get, set]
 Gets or sets the NodeAccessInfo to specify user access in Open method. More...
 
IRolePermissions RolePermissions [get, set]
 
AccessRestrictionType AccessRestriction [get, set]
 
uint NextFileHandle [get, set]
 Gets or sets the next file handle to assign. More...
 
DateTime LastModifiedTime [get, set]
 Gets or sets the LastModifiedTime More...
 
uint MaxByteStringLength [get, set]
 Gets or sets the MaxByteStringLength More...
 
string MimeType [get, set]
 Contains the media type of the file based on RFC 2046. More...
 
ushort OpenCount [get, set]
 Indicates the number of currently valid file handles on the file. More...
 
ulong Size [get, set]
 Defines the size of the file in Bytes. More...
 
bool UserWritable [get, set]
 Indicates whether the file is writable, taking user access rights into account. More...
 
bool Writable [get, set]
 Indicates whether the file is writable. More...
 
IFileMethods FileMethods [get, set]
 Gets or sets the File methods. More...
 
- Properties inherited from UnifiedAutomation.UaServer.ModelControllerBase
ModelHandle ModelHandle [get, set]
 Gets or sets the metadata handle. More...
 
object UserData [get, set]
 Gets or sets the user data. More...
 
- Properties inherited from UnifiedAutomation.UaServer.INotifyStatusCodeInfo
bool HasStatusCodes [get]
 true if no property has an explicit set status code. Hence when all status codes are implicit StatusCodes.Good. More...
 

Events

EventHandler
< ReadTrustListEventArgs
ReadTrustListRequested
 Occurs when the trust list is opened for reading. More...
 
EventHandler
< WriteTrustListEventArgs
WriteTrustListRequested
 Occurs when the trust list has been uploaded and the changes need to be applied. More...
 
EventHandler
< CertificateAddedEventArgs
AddCertificateRequested
 Occurs when the trust list has been uploaded and the changes need to be applied. More...
 
EventHandler
< RemoveCertificateEventArgs
RemoveCertificateRequested
 Occurs when the remove certificate method is called. More...
 
- Events inherited from UnifiedAutomation.UaServer.FileModel
EventHandler< OpenFileEventArgsOpenRequested
 Occurs when the file is opened. More...
 
EventHandler< CloseFileEventArgsCloseRequested
 Occurs when the file is closed. More...
 
- Events inherited from UnifiedAutomation.UaServer.ModelControllerBase
PropertyChangedEventHandler PropertyChanged
 Occurs when a property value changes. More...
 
EventHandler
< PropertyChangeRequestedEventArgs
PropertyChangeRequested
 The event is emitted just before the value will be changed, and gives the observer the opportunity to reject or adjust (e.g. clamp) the property change by setting the PropertyChangeRequestedEventArgs.StatusCode and PropertyChangeRequestedEventArgs.Value properties. More...
 
EventHandler
< StatusCodeChangedEventArgs
StatusCodeChanged
 
- Events inherited from UnifiedAutomation.UaServer.INotifyPropertyChangeRequested
EventHandler
< PropertyChangeRequestedEventArgs
PropertyChangeRequested
 The property change request event. More...
 
- Events inherited from UnifiedAutomation.UaServer.INotifyStatusCodeInfo
EventHandler
< StatusCodeChangedEventArgs
StatusCodeChanged
 Occurs if the status code of a property was changed. More...
 

Additional Inherited Members

- Public Attributes inherited from UnifiedAutomation.UaServer.ModelControllerBase
bool HasStatusCodes => m_statusCodes != null && m_statusCodes.Count > 0
 
- Protected Member Functions inherited from UnifiedAutomation.UaServer.FileModel
virtual void Dispose (bool disposing)
 An overrideable version of the Dispose. More...
 
virtual bool HasAccess (RequestContext context, UserAccessMask accessMasks)
 Determines whether the current context has specified access to the file. More...
 
void CleanupExpiredHandles ()
 Cleans up any expired handles. More...
 
StatusCode OpenStream (OpenFileHandle handle)
 Opens a stream for the file referenced by FileOnDisk. More...
 
OpenFileHandle FindHandle (RequestContext context, uint fileHandle)
 Finds the handle. More...
 
void SaveHandle (OpenFileHandle handle)
 Assigns a unique id to the handle and saves the handle. More...
 
void CloseHandle (OpenFileHandle handle)
 Closes the stream associated with the handle and sets the size of the File object. More...
 
- Protected Member Functions inherited from UnifiedAutomation.UaServer.ModelControllerBase
void RaisePropertyChangedEvent ([CallerMemberName] string propertyName=null)
 Raises an property change event. More...
 
void RaisePropertyChangeRequestedEvent< T > (T value, [CallerMemberName] string propertyName=null)
 Called when the value of a property is supposed to be changed. More...
 
bool SetField< T > (ref T field, T value, [CallerMemberName] string propertyName=null)
 Sets the backing field to the new value, and triggers a property change event, if the value has changed. More...
 
- Protected Attributes inherited from UnifiedAutomation.UaServer.FileModel
object Lock = new object()
 An object used to synchronize access to the file object. More...
 

Detailed Description

An object which represents a trust list.

Defines a UnifiedAutomation.UaServer.FileModel that can be used to access a trust list.

The CertificateManager uses this type to implement the Pull Model.

Servers use this type when implementing the Push Model.

An instance of a TrustListType must restrict access to appropriate users or applications. This may be a CertificateManager administrative user that can change the contents of a trust list, it may be an administrative user that is reading a trust list to deploy to an application host or it may be an application that can only access the trust list assigned to it.

The trust list file is a UA Binary encoded stream containing an instance of TrustListDataType.

The Open method shall not support modes other than Read (0x01) and the Write + EraseExisting (0x06).

When a Client opens the file for writing, the Server will not actually update the trust list until the UnifiedAutomation.UaServer.ITrustListMethods.CloseAndUpdate method is called. Simply calling Close will discard the updates. The bit masks in the TrustListDataType structure allow the Client to only update part of the trust list.

When the UnifiedAutomation.UaServer.ITrustListMethods.CloseAndUpdate method is called, the Server will validate all new Certificates and CRLs. If this validation fails, the trust list is not updated and the Server returns the appropriate certificate error code.

If auditing is supported, the CertificateManager shall generate the TrustListUpdatedAuditEventType when the UnifiedAutomation.UaServer.ITrustListMethods.CloseAndUpdate, UnifiedAutomation.UaServer.ITrustListMethods.AddCertificate or UnifiedAutomation.UaServer.ITrustListMethods.RemoveCertificate methods are called.

Constructor & Destructor Documentation

UnifiedAutomation.UaServer.TrustListModel.TrustListModel ( )

Initializes a new instance of the TrustListModel class.

UnifiedAutomation.UaServer.TrustListModel.TrustListModel ( TrustListModel  template,
DummyArgument  dummy = null 
)

Initializes a new instance of the TrustListModel class.

Parameters
templateThe template.
dummyDummy argument to enable writing own constructors that are called by the generated code.

Member Function Documentation

StatusCode UnifiedAutomation.UaServer.TrustListModel.AddCertificate ( RequestContext  context,
TrustListModel  model,
byte[]  certificate,
bool  isTrustedCertificate 
)

Allows a Client to add a single certificate to the trust list.

The Server always validates the certificate before adding it and returns the appropriate error code on failure.

This method cannot be called if the file object is open.

Parameters
contextThe context.
modelThe model.
certificateThe DER encoded certificate to add.
isTrustedCertificateFlag indicating whether the certificate is not an issuer certificate. If TRUE, the certificate is added to the trusted certificates list. If FALSE, the certificate is added to the issuer certificates list.
Returns
Any error that occurred during processing.

Implements UnifiedAutomation.UaServer.ITrustListMethods.

virtual StatusCode UnifiedAutomation.UaServer.TrustListModel.CloseAndUpdate ( RequestContext  context,
TrustListModel  model,
uint  fileHandle,
out bool  restartRequired 
)
virtual

Closes the file and applies the changes to the trust list.

It can only be called if the file was opened for writing.

If the file cannot be processed, this method still closes the file and discards the data before returning an error. This method is required if the Server supports writes.

The structure uploaded includes a mask which specifies which fields are updated. If a bit is not set, the associated field is not changed.

Parameters
contextThe context.
modelThe model.
fileHandleHandle of the previously opened file.
restartRequiredif set to true a restart is required.
Returns
The result of the operation.

Implements UnifiedAutomation.UaServer.ITrustListMethods.

override StatusCode UnifiedAutomation.UaServer.TrustListModel.DispatchMethod ( RequestContext  context,
MethodHandle  methodHandle,
IList< Variant inputArguments,
List< StatusCode inputArgumentResults,
List< Variant outputArguments 
)
virtual

Dispatches the method.

Parameters
contextThe context.
methodHandleThe method handle.
inputArgumentsThe input arguments.
inputArgumentResultsThe input argument results.
outputArgumentsThe output arguments.
Returns

Reimplemented from UnifiedAutomation.UaServer.FileModel.

override CallMethodEventHandler UnifiedAutomation.UaServer.TrustListModel.GetMethodDispatcher ( RequestContext  context,
NodeId  objectId,
NodeId  methodId 
)

Gets the method dispatcher.

Parameters
contextThe context.
objectIdThe object id.
methodIdThe method id.
Returns

Implements UnifiedAutomation.UaServer.IMethodDispatcher.

override StatusCode UnifiedAutomation.UaServer.TrustListModel.Open ( RequestContext  context,
FileModel  model,
byte  mode,
out uint  fileHandle 
)
virtual

Opens the specified context.

Parameters
contextThe context.
modelThe model.
modeThe mode.
fileHandleThe file handle.
Returns
The result of the operation.

Reimplemented from UnifiedAutomation.UaServer.FileModel.

virtual StatusCode UnifiedAutomation.UaServer.TrustListModel.OpenWithMasks ( RequestContext  context,
TrustListModel  model,
uint  masks,
out uint  fileHandle 
)
virtual

Allows a Client to read only a portion of the trust list.

This method can only be used to read the trust list.

Parameters
contextThe context.
modelThe model.
masksThe parts of the trust list that are include in the file to read.
fileHandleThe handle of the newly opened file.
Returns
The result of the operation.

Implements UnifiedAutomation.UaServer.ITrustListMethods.

StatusCode UnifiedAutomation.UaServer.TrustListModel.RemoveCertificate ( RequestContext  context,
TrustListModel  model,
string  thumbprint,
bool  isTrustedCertificate 
)

Allows a Client to remove a single certificate from the trust list.

It returns Bad_InvalidArgument if the thumbprint does not match a certificate in the trust list. This method cannot be called if the file object is open.

Parameters
contextThe context.
modelThe model.
thumbprintThe SHA1 hash of the certificate to remove.
isTrustedCertificateFlag indicating whether the certificate is not an issuer certificate. If TRUE, the certificate is removed from the trusted certificates list. If FALSE, the certificate is removed from the issuer certificates list.
Returns

Implements UnifiedAutomation.UaServer.ITrustListMethods.

Property Documentation

double UnifiedAutomation.UaServer.TrustListModel.ActivityTimeout
getset

Gets or sets the ActivityTimeout

TrustListValidationOptions UnifiedAutomation.UaServer.TrustListModel.DefaultValidationOptions
getset

Gets or sets the DefaultValidationOptions

DateTime UnifiedAutomation.UaServer.TrustListModel.LastUpdateTime
getset

Indicates when the trust list was last updated via trust list object methods.

This can be used to determine whether a device has an up to date trust list or to detect unexpected modifications. Out of band changes are not necessarily reported by this value.

string UnifiedAutomation.UaServer.TrustListModel.StorePath
getset

Gets or sets the store path.

The store path.

double UnifiedAutomation.UaServer.TrustListModel.UpdateFrequency
getset

Gets or sets the UpdateFrequency

Event Documentation

EventHandler<CertificateAddedEventArgs> UnifiedAutomation.UaServer.TrustListModel.AddCertificateRequested

Occurs when the trust list has been uploaded and the changes need to be applied.

EventHandler<ReadTrustListEventArgs> UnifiedAutomation.UaServer.TrustListModel.ReadTrustListRequested

Occurs when the trust list is opened for reading.

EventHandler<RemoveCertificateEventArgs> UnifiedAutomation.UaServer.TrustListModel.RemoveCertificateRequested

Occurs when the remove certificate method is called.

EventHandler<WriteTrustListEventArgs> UnifiedAutomation.UaServer.TrustListModel.WriteTrustListRequested

Occurs when the trust list has been uploaded and the changes need to be applied.


The documentation for this class was generated from the following files: