Class EncryptionKeyRotationResult
- Namespace
- Excalibur.Data.ElasticSearch.Security
- Assembly
- Excalibur.Data.ElasticSearch.dll
Represents the result of an encryption key rotation operation.
public sealed class EncryptionKeyRotationResult
- Inheritance
-
EncryptionKeyRotationResult
- Inherited Members
Remarks
Initializes a new instance of the EncryptionKeyRotationResult class.
Constructors
EncryptionKeyRotationResult(bool, ElasticSearchDataClassification, string?, string?, int, string?)
Represents the result of an encryption key rotation operation.
public EncryptionKeyRotationResult(bool success, ElasticSearchDataClassification classification, string? newKeyVersion = null, string? previousKeyVersion = null, int affectedDocumentCount = 0, string? errorMessage = null)
Parameters
successboolWhether the key rotation was successful.
classificationElasticSearchDataClassificationThe data classification level that was rotated.
newKeyVersionstringThe version of the new encryption key.
previousKeyVersionstringThe version of the previous encryption key.
affectedDocumentCountintThe number of documents that were re-encrypted.
errorMessagestringOptional error message if rotation failed.
Remarks
Initializes a new instance of the EncryptionKeyRotationResult class.
Properties
AffectedDocumentCount
Gets the number of documents that were re-encrypted with the new key.
public int AffectedDocumentCount { get; }
Property Value
- int
The count of documents affected by the key rotation.
Classification
Gets the data classification level that was rotated.
public ElasticSearchDataClassification Classification { get; }
Property Value
- ElasticSearchDataClassification
The classification level for which keys were rotated.
ErrorMessage
Gets the error message if rotation failed.
public string? ErrorMessage { get; }
Property Value
- string
A descriptive error message, or null if rotation succeeded.
NewKeyVersion
Gets the version of the new encryption key.
public string? NewKeyVersion { get; }
Property Value
- string
The version identifier for the new key, or null if rotation failed.
PreviousKeyVersion
Gets the version of the previous encryption key.
public string? PreviousKeyVersion { get; }
Property Value
- string
The version identifier for the previous key, or null if not available.
RotatedAt
Gets the timestamp when the key rotation occurred.
public DateTimeOffset RotatedAt { get; }
Property Value
- DateTimeOffset
The UTC timestamp of the key rotation operation.
Success
Gets a value indicating whether the key rotation was successful.
public bool Success { get; }
Property Value
- bool
True if the key rotation completed successfully, false otherwise.
Methods
CreateFailure(ElasticSearchDataClassification, string)
Creates a failed key rotation result.
public static EncryptionKeyRotationResult CreateFailure(ElasticSearchDataClassification classification, string errorMessage)
Parameters
classificationElasticSearchDataClassificationThe data classification level that failed to rotate.
errorMessagestringThe error message describing the failure.
Returns
- EncryptionKeyRotationResult
A failed key rotation result.
CreateSuccess(ElasticSearchDataClassification, string, string, int)
Creates a successful key rotation result.
public static EncryptionKeyRotationResult CreateSuccess(ElasticSearchDataClassification classification, string newKeyVersion, string previousKeyVersion, int affectedDocumentCount = 0)
Parameters
classificationElasticSearchDataClassificationThe data classification level that was rotated.
newKeyVersionstringThe version of the new encryption key.
previousKeyVersionstringThe version of the previous encryption key.
affectedDocumentCountintThe number of documents that were re-encrypted.
Returns
- EncryptionKeyRotationResult
A successful key rotation result.