XmlKeyManager Class¶
A key manager backed by an Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository
.
- Namespace
Microsoft.AspNetCore.DataProtection.KeyManagement
- Assemblies
- Microsoft.AspNetCore.DataProtection
Syntax¶
public sealed class XmlKeyManager : IKeyManager, IInternalXmlKeyManager
-
class
Microsoft.AspNetCore.DataProtection.KeyManagement.
XmlKeyManager
Constructors¶
-
XmlKeyManager
(Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository, Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration, System.IServiceProvider)¶ Creates an
Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager
.Arguments: - repository (Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository) – The repository where keys are stored.
- configuration (Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration) – Configuration for newly-created keys.
- services (System.IServiceProvider) – A provider of optional services.
public XmlKeyManager(IXmlRepository repository, IAuthenticatedEncryptorConfiguration configuration, IServiceProvider services)
-
Methods¶
-
CreateNewKey
(System.DateTimeOffset, System.DateTimeOffset)¶ Return type: Microsoft.AspNetCore.DataProtection.KeyManagement.IKey public IKey CreateNewKey(DateTimeOffset activationDate, DateTimeOffset expirationDate)
-
GetAllKeys
()¶ Return type: System.Collections.Generic.IReadOnlyCollection<Microsoft.AspNetCore.DataProtection.KeyManagement.IKey> public IReadOnlyCollection<IKey> GetAllKeys()
-
GetCacheExpirationToken
()¶ Return type: System.Threading.CancellationToken public CancellationToken GetCacheExpirationToken()
-
CreateNewKey
(System.Guid, System.DateTimeOffset, System.DateTimeOffset, System.DateTimeOffset) Return type: Microsoft.AspNetCore.DataProtection.KeyManagement.IKey IKey IInternalXmlKeyManager.CreateNewKey(Guid keyId, DateTimeOffset creationDate, DateTimeOffset activationDate, DateTimeOffset expirationDate)
-
DeserializeDescriptorFromKeyElement
(System.Xml.Linq.XElement)¶ Return type: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor IAuthenticatedEncryptorDescriptor IInternalXmlKeyManager.DeserializeDescriptorFromKeyElement(XElement keyElement)
-
RevokeSingleKey
(System.Guid, System.DateTimeOffset, System.String)¶ void IInternalXmlKeyManager.RevokeSingleKey(Guid keyId, DateTimeOffset revocationDate, string reason)
-
RevokeAllKeys
(System.DateTimeOffset, System.String)¶ public void RevokeAllKeys(DateTimeOffset revocationDate, string reason = null)
-
RevokeKey
(System.Guid, System.String)¶ public void RevokeKey(Guid keyId, string reason = null)
-