C# Class Opc.Ua.WindowsCertificateStore

Provides access to a simple file based certificate store.
Inheritance: ICertificateStore
Afficher le fichier Open project: OPCFoundation/Misc-Tools Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Cleans up all resources held by the object.

Private Methods

Méthode Description
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.

Method Details

Add() public méthode

public Add ( X509Certificate2 certificate ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
Résultat void

AddCRL() public méthode

Adds a CRL to the store.
public AddCRL ( X509CRL crl ) : void
crl X509CRL
Résultat void

Close() public méthode

public Close ( ) : void
Résultat void

Delete() public méthode

public Delete ( string thumbprint ) : bool
thumbprint string
Résultat bool

DeleteCRL() public méthode

Removes a CRL from the store.
public DeleteCRL ( X509CRL crl ) : bool
crl X509CRL
Résultat bool

Dispose() public méthode

May be called by the application to clean up resources.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Cleans up all resources held by the object.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Enumerate() public méthode

public Enumerate ( ) : X509Certificate2Collection
Résultat System.Security.Cryptography.X509Certificates.X509Certificate2Collection

EnumerateCRLs() public méthode

Returns the CRLs in the store.
public EnumerateCRLs ( ) : List
Résultat List

EnumerateCRLs() public méthode

Returns the CRLs for the issuer.
public EnumerateCRLs ( X509Certificate2 issuer ) : List
issuer System.Security.Cryptography.X509Certificates.X509Certificate2
Résultat List

EnumerateStores() public static méthode

Enumerates the available windows certificate store.
public static EnumerateStores ( WindowsStoreType storeType, string hostName, string serviceNameOrUserSid ) : IList
storeType WindowsStoreType
hostName string
serviceNameOrUserSid string
Résultat IList

FindByThumbprint() public méthode

public FindByThumbprint ( string thumbprint ) : X509Certificate2
thumbprint string
Résultat System.Security.Cryptography.X509Certificates.X509Certificate2

Format() public méthode

Returns the string representation of the store.
public Format ( ) : string
Résultat string

GetAccessRules() public méthode

public GetAccessRules ( ) : IList
Résultat IList

GetAccessRules() public méthode

public GetAccessRules ( string thumbprint ) : IList
thumbprint string
Résultat IList

GetPrivateKeyFilePath() public méthode

public GetPrivateKeyFilePath ( string thumbprint ) : string
thumbprint string
Résultat string

IsRevoked() public méthode

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
Résultat Opc.Ua.StatusCode

Open() public méthode

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
Résultat void

PermanentlyDeleteStore() public méthode

Deletes the store and all certificates contained within it.
public PermanentlyDeleteStore ( ) : void
Résultat void

SetAccessRules() public méthode

public SetAccessRules ( IList rules, bool replaceExisting ) : void
rules IList
replaceExisting bool
Résultat void

SetAccessRules() public méthode

public SetAccessRules ( string thumbprint, IList rules, bool replaceExisting ) : void
thumbprint string
rules IList
replaceExisting bool
Résultat void

WindowsCertificateStore() public méthode

Initializes a store.
public WindowsCertificateStore ( ) : System
Résultat System