XMLKeyManager doesn't implement IDeletableKeyManager interface for .NET 9 target. #60315
Unanswered
ashishdhingra
asked this question in
Q&A
Replies: 1 comment 2 replies
-
That seems like a mistake. The API was approved with You can workaround this by doing a type check (and the code sample seems wrong since it doesn't check if (keyManager is XmlKeyManager xmlKeyManager && xmlKeyManager.CanDeleteKeys)
{
if (!xmlKeyManager.DeleteKeys(key => key.ExpirationDate < yearAgo))
{
Console.WriteLine("Failed to delete keys.");
}
// ...
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Documentation at Delete keys has an example approach on how to delete old expired data protection keys as below:
There is a condition which checks for
keyManager is IDeletableKeyManager deletableKeyManager
.However, the default XmlKeyManager doesn't implement
IDeletableKeyManager
interface. Just curious if this was intentional or a miss.Thanks,
Ashish
Beta Was this translation helpful? Give feedback.
All reactions