.NET Based OPC UA Client/Server SDK  3.1.3.516
UnifiedAutomation.UaBase.WindowsCertificateStore Class Reference

Provides access to the windows certificate store. More...

Inherits UnifiedAutomation.UaBase.ICertificateStore.

Public Member Functions

 WindowsCertificateStore (string storePath)
 Initializes a new instance of the WindowsCertificateStore class. More...
 
 WindowsCertificateStore (CertificateStoreSettings settings)
 Initializes a new instance of the WindowsCertificateStore class. More...
 
void Dispose ()
 May be called by the application to clean up resources. More...
 
virtual ICertificate Find (string subjectName, string thumbprint, bool needPrivateKey=false)
 Finds a certificate in the store. More...
 
ICertificate Find (string thumbprint, bool needPrivateKey=false)
 Finds a certificate in the store. More...
 
virtual ICertificate Find (string subjectName, string thumbprint, bool needPrivateKey, string privateKeyPassword)
 Finds a certificate in the store. More...
 
virtual void Add (ICertificate certificate, bool replaceExisting, bool savePrivateKey)
 Adds the specified certificate to the store. More...
 
virtual void Add (ICertificate certificate, bool replaceExisting, bool savePrivateKey, string privateKeyPassword)
 Adds the specified certificate to the store. More...
 
virtual void Remove (string thumbprint)
 Removes the specified thumbprint. More...
 
virtual StatusCode IsRevoked (ICertificate issuer, ICertificate certificate)
 Determines whether the specified certificate has been revoked by the issuer. More...
 
virtual string GetPrivateKeyFilePath (string thumbprint)
 Gets the private key file path. More...
 
virtual ICertificateRevocationList ParseCRL (byte[] derData)
 Parse the raw representation of a CRL. More...
 
virtual IList
< ICertificateRevocationList
GetCRLs (ICertificate issuer)
 Returns the certificate revocation lists for an issuer. More...
 
virtual void AddCRLs (IList< ICertificateRevocationList > crls, bool deleteExisting)
 Adds crls to the store. More...
 
virtual IEnumerator< ICertificateGetEnumerator ()
 Returns an enumerator that iterates through the collection. More...
 
string Format ()
 Returns the string representation of the store. More...
 

Static Public Member Functions

static IList
< WindowsCertificateStore
EnumerateStores (WindowsStoreType storeType, string hostName, string serviceNameOrUserSid)
 Enumerates the available windows certificate store. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Cleans up all resources held by the object. More...
 

Properties

string StoreType [get]
 
string StorePath [get]
 
string SymbolicName [get]
 The symbolic name for the store. More...
 
WindowsStoreType WindowsStoreType [get]
 The type of windows store. More...
 
string HostName [get]
 The name of the machine. More...
 
string ServiceNameOrUserSid [get]
 The service name or user SID. More...
 
CertificateValidationOptions ValidationOptions [get]
 Gets or sets the validation options. More...
 
- Properties inherited from UnifiedAutomation.UaBase.ICertificateStore
string StoreType [get]
 Gets the store type. More...
 
string StorePath [get]
 Gets the store path. More...
 
CertificateValidationOptions ValidationOptions [get]
 Gets or sets the validation options. More...
 

Detailed Description

Provides access to the windows certificate store.

The WindowsCertificateStore does not support CRLs.

Constructor & Destructor Documentation

UnifiedAutomation.UaBase.WindowsCertificateStore.WindowsCertificateStore ( string  storePath)

Initializes a new instance of the WindowsCertificateStore class.

Parameters
storePathThe store path.

Syntax (items enclosed in [] are optional):
[\HostName\]StoreType[\(ServiceName | UserSid)]\SymbolicName

HostName
the name of the machine where the store resides.
SymbolicName
one of LocalMachine, CurrentUser, User or Service
ServiceName
the name of an NT service.
UserSid
the SID for a user account.
SymbolicName
the symbolic name of the store (e.g. My, Root, Trust, CA, etc.).

Examples:
\MYPC\LocalMachine\My
CurrentUser\Trust
\MYPC\Service\My UA Server\UA Applications
User\S-1-5-25\Root

UnifiedAutomation.UaBase.WindowsCertificateStore.WindowsCertificateStore ( CertificateStoreSettings  settings)

Initializes a new instance of the WindowsCertificateStore class.

Parameters
settingsThe store settings

Syntax of settings.StorePath (items enclosed in [] are optional):
[\HostName\]StoreType[\(ServiceName | UserSid)]\SymbolicName

HostName
the name of the machine where the store resides.
SymbolicName
one of LocalMachine, CurrentUser, User or Service
ServiceName
the name of an NT service.
UserSid
the SID for a user account.
SymbolicName
the symbolic name of the store (e.g. My, Root, Trust, CA, etc.).

Examples:
\MYPC\LocalMachine\My
CurrentUser\Trust
\MYPC\Service\My UA Server\UA Applications
User\S-1-5-25\Root

Member Function Documentation

virtual void UnifiedAutomation.UaBase.WindowsCertificateStore.Add ( ICertificate  certificate,
bool  replaceExisting,
bool  savePrivateKey 
)
virtual

Adds the specified certificate to the store.

Parameters
certificateThe certificate.
replaceExistingIf set to true any existing certificate is replaced.
savePrivateKeyIf set to true any private key is saved as well.
virtual void UnifiedAutomation.UaBase.WindowsCertificateStore.Add ( ICertificate  certificate,
bool  replaceExisting,
bool  savePrivateKey,
string  privateKeyPassword 
)
virtual

Adds the specified certificate to the store.

Parameters
certificateThe certificate.
replaceExistingIf set to true any existing certificate is replaced.
savePrivateKeyIf set to true any private key is saved as well.
privateKeyPasswordMust be null or empty.

Implements UnifiedAutomation.UaBase.ICertificateStore.

virtual void UnifiedAutomation.UaBase.WindowsCertificateStore.AddCRLs ( IList< ICertificateRevocationList crls,
bool  deleteExisting 
)
virtual

Adds crls to the store.

Throws NotSupportedException. Must be implemented by subclass.
Is called by ServerManger.OnTrustListWrite.

Parameters
crls
deleteExisting

Implements UnifiedAutomation.UaBase.ICertificateStore.

void UnifiedAutomation.UaBase.WindowsCertificateStore.Dispose ( )

May be called by the application to clean up resources.

virtual void UnifiedAutomation.UaBase.WindowsCertificateStore.Dispose ( bool  disposing)
protectedvirtual

Cleans up all resources held by the object.

static IList<WindowsCertificateStore> UnifiedAutomation.UaBase.WindowsCertificateStore.EnumerateStores ( WindowsStoreType  storeType,
string  hostName,
string  serviceNameOrUserSid 
)
static

Enumerates the available windows certificate store.

virtual ICertificate UnifiedAutomation.UaBase.WindowsCertificateStore.Find ( string  subjectName,
string  thumbprint,
bool  needPrivateKey = false 
)
virtual

Finds a certificate in the store.

Parameters
subjectNameThe subject name.
thumbprintThe thumbprint.
needPrivateKeyIf set to true the certificate is only returned if a private key is accessible.
Returns
ICertificate UnifiedAutomation.UaBase.WindowsCertificateStore.Find ( string  thumbprint,
bool  needPrivateKey = false 
)

Finds a certificate in the store.

Calls ICertificate Find(string subjectName, string thumbprint, bool needPrivateKey)

Parameters
thumbprintThe thumbprint.
needPrivateKeyIf set to true the certificate is only returned if a private key is accessible.
Returns

Implements UnifiedAutomation.UaBase.ICertificateStore.

virtual ICertificate UnifiedAutomation.UaBase.WindowsCertificateStore.Find ( string  subjectName,
string  thumbprint,
bool  needPrivateKey,
string  privateKeyPassword 
)
virtual

Finds a certificate in the store.

Calls ICertificate Find(string subjectName, string thumbprint, bool needPrivateKey)

Parameters
subjectNameThe subject name.
thumbprintThe thumbprint.
needPrivateKeyIf set to true the certificate is only returned if a private key is accessible.
privateKeyPasswordMust be null or empty

Implements UnifiedAutomation.UaBase.ICertificateStore.

string UnifiedAutomation.UaBase.WindowsCertificateStore.Format ( )

Returns the string representation of the store.

virtual IList<ICertificateRevocationList> UnifiedAutomation.UaBase.WindowsCertificateStore.GetCRLs ( ICertificate  issuer)
virtual

Returns the certificate revocation lists for an issuer.

Throws NotSupportedException. Must be implemented by subclass.
Is called by ServerManger.OnTrustListRead.

Parameters
issuerThe issuer of the returned crls. If null, all crls in the store must be returned.
Returns

Implements UnifiedAutomation.UaBase.ICertificateStore.

virtual IEnumerator<ICertificate> UnifiedAutomation.UaBase.WindowsCertificateStore.GetEnumerator ( )
virtual

Returns an enumerator that iterates through the collection.

Returns
A T:System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection.
virtual string UnifiedAutomation.UaBase.WindowsCertificateStore.GetPrivateKeyFilePath ( string  thumbprint)
virtual

Gets the private key file path.

Parameters
thumbprintThe thumbprint.
Returns

Implements UnifiedAutomation.UaBase.ICertificateStore.

virtual StatusCode UnifiedAutomation.UaBase.WindowsCertificateStore.IsRevoked ( ICertificate  issuer,
ICertificate  certificate 
)
virtual

Determines whether the specified certificate has been revoked by the issuer.

Parameters
issuerThe issuer.
certificateThe certificate.
Returns
StatusCodes.BadCertificateRevocationUnknown since CRLs are not supported by this class.

Implements UnifiedAutomation.UaBase.ICertificateStore.

virtual ICertificateRevocationList UnifiedAutomation.UaBase.WindowsCertificateStore.ParseCRL ( byte[]  derData)
virtual

Parse the raw representation of a CRL.

Throws NotSupportedException. Must be implemented by subclass.
Is called by ServerManger.OnTrustListWrite with single elements of TrustListDataType.IssuerCrls.

Parameters
derDataThe raw data of the crl.
Returns

Implements UnifiedAutomation.UaBase.ICertificateStore.

virtual void UnifiedAutomation.UaBase.WindowsCertificateStore.Remove ( string  thumbprint)
virtual

Removes the specified thumbprint.

Parameters
thumbprintThe thumbprint.

Implements UnifiedAutomation.UaBase.ICertificateStore.

Property Documentation

string UnifiedAutomation.UaBase.WindowsCertificateStore.HostName
get

The name of the machine.

string UnifiedAutomation.UaBase.WindowsCertificateStore.ServiceNameOrUserSid
get

The service name or user SID.

string UnifiedAutomation.UaBase.WindowsCertificateStore.SymbolicName
get

The symbolic name for the store.

CertificateValidationOptions UnifiedAutomation.UaBase.WindowsCertificateStore.ValidationOptions
get

Gets or sets the validation options.

The validation options.

WindowsStoreType UnifiedAutomation.UaBase.WindowsCertificateStore.WindowsStoreType
get

The type of windows store.


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