ComponentSpace

Forums



Keyset does not exist error on Azure


Keyset does not exist error on Azure

Author
Message
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
My suspicion is this is related to the private key.

Have you tried something like the following?


new X509Certificate2(
   Convert.FromBase64String(certContentSecret.Value),
   string.Empty,
   X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);



The EphemeralKeySet flag specifies that the private key should not persisted to disk.

Regards
ComponentSpace Development
Anshuman
Anshuman
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)

Group: Forum Members
Posts: 4, Visits: 7
ComponentSpace - 1/6/2021
My suspicion is this is related to the private key.

Have you tried something like the following?


new X509Certificate2(
   Convert.FromBase64String(certContentSecret.Value),
   string.Empty,
   X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);



The EphemeralKeySet flag specifies that the private key should not persisted to disk.

We've tried:

new X509Certificate2(
   Convert.FromBase64String(certContentSecret.Value),
   string.Empty,
   X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);


Shouldn't the PersistKeySet option have fixed the issue as then the key files will not be deleted upon certificate disposal?
Also we are targetting netstandard 2.0 and the option for "EphemeralKeySet" was introduced in .netstandard 2.1. We have a lot of dependencies on this project so not sure if we could just upgrade to 2.1
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
We haven't been able to reproduce this error so it's not something we've been able to investigate thoroughly.

Have you asked Microsoft support or on stackoverflow?

If you find a solution please add a comment here for anyone else who might run into the issue. 

Regards
ComponentSpace Development
GO


Similar Topics


Execution: 0.000. 2 queries. Compression Enabled.
Login
Existing Account
Email Address:


Password:


Select a Forum....












Forums, Documentation & Knowledge Base - ComponentSpace


Search