Class X509CertificateIdentityDefinitionBase
Provides a base class for X.509 certificate based identities.
Inheritance
Inherited Members
Namespace: Nevatech.Vsb.Repository.Services.Identities
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public abstract class X509CertificateIdentityDefinitionBase : IdentityDefinitionBase, IValidator, IExtensibleDataObject, IX509CertificateIdentity
Constructors
X509CertificateIdentityDefinitionBase()
Initializes an empty instance.
Declaration
protected X509CertificateIdentityDefinitionBase()
X509CertificateIdentityDefinitionBase(Identity)
Initializes new instance from provided Identity object.
Declaration
protected X509CertificateIdentityDefinitionBase(Identity identity)
Parameters
Type | Name | Description |
---|---|---|
Identity | identity | Identity object used to populate new instance. |
X509CertificateIdentityDefinitionBase(Byte[])
Initializes new instance from provided certificate's raw bytes.
Declaration
protected X509CertificateIdentityDefinitionBase(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Byte array containing serialized X.509 certificate. |
X509CertificateIdentityDefinitionBase(X509Certificate2, Boolean)
Initializes new instance from provided X.509 certificate.
Declaration
protected X509CertificateIdentityDefinitionBase(X509Certificate2 certificate, bool storePrivateKey)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | certificate | X.509 certificate used to initialize new instance. |
System.Boolean | storePrivateKey | Flag indicating that private key must be exported to RawData property. |
Properties
FriendlyName
Gets or sets the friendly name describing stored identity.
Declaration
public override sealed string FriendlyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
RawData
Gets the byte array containing serialized X.509 certificate.
Declaration
public byte[] RawData { get; protected set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Thumbprint
Gets the certificate's thumbprint value as Base64-encoded string.
Declaration
public string Thumbprint { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetCertificate(Boolean)
Returns X.509 certificate represented by this identity.
Declaration
public X509Certificate2 GetCertificate(bool mustHavePrivateKey)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | mustHavePrivateKey | Flag indicating that returned X.509 certificate must have a private key. If key does not exists or is not accessible than exception will be thrown. |
Returns
Type | Description |
---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | X.509 certificate represented by this identity. |
GetIdentity()
Returns Identity object populated with the data stored in this instance.
Declaration
public override Identity GetIdentity()
Returns
Type | Description |
---|---|
Identity | Identity object populated with the data stored in this instance. |
Overrides
InitializeFromCertificate(X509Certificate2, Boolean)
Populates instance properties from the provided certificate.
Declaration
protected void InitializeFromCertificate(X509Certificate2 certificate = null, bool storePrivateKey = false)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | certificate | X.509 certificate to be initialized from. If certificate is NULL then it will be loaded from the RawData property. |
System.Boolean | storePrivateKey | Flag indicating that private key must be exported to the serialized
certificate's bytes. This flag is only applied if parameter
|
Validate()
Validates this domain object's state.
Declaration
public override bool Validate()
Returns
Type | Description |
---|---|
System.Boolean | True if object's state is valid; otherwise, false. |