C# Класс Opc.Ua.WindowsCertificateStore

Provides access to a simple file based certificate store.
Наследование: ICertificateStore
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( X509Certificate2 certificate ) : void
AddCRL ( X509CRL crl ) : void

Adds a CRL to the store.

Close ( ) : void
Delete ( string thumbprint ) : bool
DeleteCRL ( X509CRL crl ) : bool

Removes a CRL from the store.

Dispose ( ) : void

May be called by the application to clean up resources.

Enumerate ( ) : X509Certificate2Collection
EnumerateCRLs ( ) : List

Returns the CRLs in the store.

EnumerateCRLs ( X509Certificate2 issuer ) : List

Returns the CRLs for the issuer.

EnumerateStores ( WindowsStoreType storeType, string hostName, string serviceNameOrUserSid ) : IList

Enumerates the available windows certificate store.

FindByThumbprint ( string thumbprint ) : X509Certificate2
Format ( ) : string

Returns the string representation of the store.

GetAccessRules ( ) : IList
GetAccessRules ( string thumbprint ) : IList
GetPrivateKeyFilePath ( string thumbprint ) : string
IsRevoked ( X509Certificate2 issuer, X509Certificate2 certificate ) : Opc.Ua.StatusCode

Checks if issuer has revoked the certificate.

Open ( string location ) : void 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
PermanentlyDeleteStore ( ) : void

Deletes the store and all certificates contained within it.

SetAccessRules ( IList rules, bool replaceExisting ) : void
SetAccessRules ( string thumbprint, IList rules, bool replaceExisting ) : void
WindowsCertificateStore ( ) : System

Initializes a store.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Cleans up all resources held by the object.

Приватные методы

Метод Описание
Copy ( byte bytes ) : IntPtr

Makes an unmanaged copy of an array.

DuplicateString ( string text ) : IntPtr

converts a managed string to an unmanaged string (allocated with malloc).

EnumStoreCallback ( IntPtr pvSystemStore, uint dwFlags, IntPtr pStoreInfo, IntPtr pvReserved, IntPtr pvArg ) : int
FindCertificate ( IntPtr hStore, string thumbprint ) : IntPtr

Finds a certificate in the store.

GetCspKeyContainerInfo ( IntPtr hStore, string thumbprint, string symbolicName, WindowsStoreType storeType ) : CspKeyContainerInfo

returns the information for the key container associated with the certificate.

GetFlags ( WindowsStoreType storeType ) : uint

maps the store type onto a set of flags that can be passed to the various crypto functions.

GetKeyFileInfo ( string uniqueId, WindowsStoreType storeType, string userSid ) : FileInfo

finds the key file.

GetStoreDisplayName ( WindowsStoreType storeType, string serviceNameOrUserSid, string storeName ) : string

Returns the display name for the certificate store.

GetThumbprint ( IntPtr pCertContext ) : string

Gets the thumbprint from the certificate context.

OpenStore ( bool readOnly, bool createAlways, bool throwIfNotExist ) : IntPtr

Opens the certificate store.

Parse ( string location ) : void

Parses the a string representing the store location.

Описание методов

Add() публичный Метод

public Add ( X509Certificate2 certificate ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
Результат void

AddCRL() публичный Метод

Adds a CRL to the store.
public AddCRL ( X509CRL crl ) : void
crl X509CRL
Результат void

Close() публичный Метод

public Close ( ) : void
Результат void

Delete() публичный Метод

public Delete ( string thumbprint ) : bool
thumbprint string
Результат bool

DeleteCRL() публичный Метод

Removes a CRL from the store.
public DeleteCRL ( X509CRL crl ) : bool
crl X509CRL
Результат bool

Dispose() публичный Метод

May be called by the application to clean up resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Cleans up all resources held by the object.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

Enumerate() публичный Метод

public Enumerate ( ) : X509Certificate2Collection
Результат System.Security.Cryptography.X509Certificates.X509Certificate2Collection

EnumerateCRLs() публичный Метод

Returns the CRLs in the store.
public EnumerateCRLs ( ) : List
Результат List

EnumerateCRLs() публичный Метод

Returns the CRLs for the issuer.
public EnumerateCRLs ( X509Certificate2 issuer ) : List
issuer System.Security.Cryptography.X509Certificates.X509Certificate2
Результат List

EnumerateStores() публичный статический Метод

Enumerates the available windows certificate store.
public static EnumerateStores ( WindowsStoreType storeType, string hostName, string serviceNameOrUserSid ) : IList
storeType WindowsStoreType
hostName string
serviceNameOrUserSid string
Результат IList

FindByThumbprint() публичный Метод

public FindByThumbprint ( string thumbprint ) : X509Certificate2
thumbprint string
Результат System.Security.Cryptography.X509Certificates.X509Certificate2

Format() публичный Метод

Returns the string representation of the store.
public Format ( ) : string
Результат string

GetAccessRules() публичный Метод

public GetAccessRules ( ) : IList
Результат IList

GetAccessRules() публичный Метод

public GetAccessRules ( string thumbprint ) : IList
thumbprint string
Результат IList

GetPrivateKeyFilePath() публичный Метод

public GetPrivateKeyFilePath ( string thumbprint ) : string
thumbprint string
Результат string

IsRevoked() публичный Метод

Checks if issuer has revoked the certificate.
public IsRevoked ( X509Certificate2 issuer, X509Certificate2 certificate ) : Opc.Ua.StatusCode
issuer System.Security.Cryptography.X509Certificates.X509Certificate2
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
Результат Opc.Ua.StatusCode

Open() публичный Метод

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
public Open ( string location ) : void
location string
Результат void

PermanentlyDeleteStore() публичный Метод

Deletes the store and all certificates contained within it.
public PermanentlyDeleteStore ( ) : void
Результат void

SetAccessRules() публичный Метод

public SetAccessRules ( IList rules, bool replaceExisting ) : void
rules IList
replaceExisting bool
Результат void

SetAccessRules() публичный Метод

public SetAccessRules ( string thumbprint, IList rules, bool replaceExisting ) : void
thumbprint string
rules IList
replaceExisting bool
Результат void

WindowsCertificateStore() публичный Метод

Initializes a store.
public WindowsCertificateStore ( ) : System
Результат System