X509PrivateKeyBuilder Class

Represents a managed X.509 private key generator.

Definition

Namespace: SysadminsLV.PKI.Cryptography
Assembly: SysadminsLV.PKI.Win (in SysadminsLV.PKI.Win.dll) Version: 4.0.1.0 (4.0.1.0)
C#
public class X509PrivateKeyBuilder : IKeyStorageInfo, 
	IDisposable
Inheritance
Object    X509PrivateKeyBuilder
Implements
IKeyStorageInfo, IDisposable

Constructors

X509PrivateKeyBuilderInitializes a new instance of the X509PrivateKeyBuilder class

Properties

Exportable Gets or sets the flag that indicates whether the private key is exportable or not. For hardware providers, this flag is set to False and cannot be modified.
KeyContainerName Gets or sets key container name that is used to store the key material within key provider.
KeyLength Gets or sets asymmetric public key length in bits. For elliptic curve cryptography (ECC), this member is automatically populated from PublicKeyAlgorithm member value, because ECC curve includes key length.
KeyProtection Gets or sets private key protection options when the key is accessded.
KeySpec Gets or sets a value that identifies whether a private key can be used for signing, or encryption, or both.
MachineContext Gets or sets the value that indicates whether the key is stored in machine or current user context.
ProviderName Gets or sets a legacy cryptographic service provider (CSP) or CNG key storage provider (KSP).
ProviderType Gets provider type. Provider type is cryptographic service provider family and is used only with legacy CSP. This member is automatically populated after invoking Create method.
PublicKeyAlgorithm Gets or sets public key algorithm. For CNG keys, key and curve name must be used. For example, "ECDSA_P256", "ECDH_brainpoolP320r1". When not set, default key algorithm for specified provider is used and depends on a particular cryptographic service provider (CSP or KSP).
SecurityDescriptor Gets or sets an access control list to private key in a SDDL form.

Methods

Create Creates a new asymmetric key pair based on a current configuration. If the method succeeds, all properties of this object are read-only and will throw exception when setter accessor is accessed.
Delete Deletes generated private key material from key storage. For software-based providers, the key is deleted from file system, for hardware-based providers, the key is deleted from hardware. When hardware-based provider is used, a PIN prompt dialog may appear.
DisposeReleases all resources used by the X509PrivateKeyBuilder
Equals
(Inherited from Object)
Finalize
(Overrides ObjectFinalize)
GetHashCode
(Inherited from Object)
GetPublicKey Gets public portion of the key pair.
GetType
(Inherited from Object)
MemberwiseClone
(Inherited from Object)
ToString
(Inherited from Object)

See Also