Class X509Context
Defines the CAPI store, file system location and name for an X509Cryto encryption context
Inheritance
Namespace: Org.X509Crypto
Assembly: EasyPKIView.dll
Syntax
public class X509Context : object
Fields
SystemFull
Provides read/write access to the context of the currently logged in (or impersonated) user.
Declaration
public static readonly X509Context SystemFull
Field Value
Type | Description |
---|---|
X509Context |
SystemReadOnly
Provides read-only access to the context of the currently logged in (or impersonated) user.
Declaration
public static readonly X509Context SystemReadOnly
Field Value
Type | Description |
---|---|
X509Context |
UserFull
Provides read/write access to the context of the currently logged in (or impersonated) user.
Declaration
public static readonly X509Context UserFull
Field Value
Type | Description |
---|---|
X509Context |
UserReadOnly
Provides read-only access to the context of the currently logged in (or impersonated) user.
Declaration
public static readonly X509Context UserReadOnly
Field Value
Type | Description |
---|---|
X509Context |
Properties
Aliases
Declaration
public List<string> Aliases { get; }
Property Value
Type | Description |
---|---|
List<System.String> |
Location
The CAPI store where an encryption certificate and key pair are contained
Declaration
public StoreLocation Location { get; }
Property Value
Type | Description |
---|---|
StoreLocation |
Name
The human-readable name of the context
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
StorageDirectory
The path where X509Alias files created in the context are stored. For "User" it is "C:\Users\[sAMAccountName]\AppData\Local\X509Crypto" For "System" it is "C:\ProgramData\X509Crypto"
Declaration
public string StorageDirectory { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetAliases(Boolean)
Returns the collection of all X509Aliases found in this context
Declaration
public List<X509Alias> GetAliases(bool includeIfCertNotFound = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | includeIfCertNotFound |
Returns
Type | Description |
---|---|
List<X509Alias> | the collection of all X509Aliases found in this context |
MakeCertWorker(String, Int32, Int32, out String)
Generates a self-signed encryption certificate
Declaration
public void MakeCertWorker(string name, int keyLength, int yearsValid, out string thumbprint)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The certificate subject |
System.Int32 | keyLength | The desired public key length (multiples of 1024) |
System.Int32 | yearsValid | The number of years after which the certificate should be considered expired |
System.String | thumbprint | reference string which will contain the thumbprint of the generated certificate |
Select(String, Boolean)
Returns an X509Context object based on the indicated expression
Declaration
public static X509Context Select(string name, bool writeable)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the desired X509Context |
System.Boolean | writeable | Determines whether the X509Context should be writeable or not (this feature currently has no impact) |
Returns
Type | Description |
---|---|
X509Context | An X509Context object |