X509Certificate2构造函数抛出Internal.Cryptography.CryptoThrowHelper + WindowsCryptographicException:磁盘上没有足

编程入门 行业动态 更新时间:2024-10-25 20:28:18
本文介绍了X509Certificate2构造函数抛出Internal.Cryptography.CryptoThrowHelper + WindowsCryptographicException:磁盘上没有足够的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我遇到了类似的问题,该问题在此处.这是在Azure App Service中作为Azure WebJob运行的.NET Core 3.1 App.根据上面链接中的讨论,我认为这是目录中文件计数的问题,我很难确定哪个目录已满.Kudu门户上的环境页面显示了这一点,基本上似乎并不是总体磁盘空间问题-

I am running into a similar issue that is described here. This is a .NET Core 3.1 App running as a Azure WebJob in Azure App Service. Based on the discussion in the above link, I assume this is an issue with file counts in a directory, I am having trouble figuring out which directory is getting full. The environments page on the Kudu portal shows this, basically doesn't seem to be a overall disk space issue-

D:\home usage: 57,344 MB total; 56,795 MB free d:\local usage: 11,264 MB total; 10,683 MB free

我也确实查看了以上链接中提到的路径,但没有取得很大的成功.在尝试相关问题中建议的代码修复之前,是否有办法弄清楚哪个是违规路径?

I also did look at the paths mentioned in the above link without much success. Is there a way to figure out which is the offending path, before I try the code fix suggested in the related issue?

[08/02/2020 09:20:53 > 4708f0: INFO] Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: There is not enough space on the disk. [08/02/2020 09:20:53 > 4708f0: INFO] at Internal.Cryptography.Pal.CertificatePal.FilterPFXStore(Byte[] rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags) [08/02/2020 09:20:53 > 4708f0: INFO] at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[] rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) [08/02/2020 09:20:53 > 4708f0: INFO] at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags) [08/02/2020 09:20:53 > 4708f0: INFO] at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password)

推荐答案

除非PFX装有 X509KeyStorageFlags.EphemeralKeySet ,否则私钥材料将写入磁盘.特定位置取决于PFX中的信息,但是在所有PFX负载的99.99%中使用的目录记录在 docs.microsoft/zh-cn/windows/win32/seccng/key-storage-and-retrieval#key-directories-and-files .

Unless a PFX is loaded with X509KeyStorageFlags.EphemeralKeySet, the private key material is written to disk. The particular place depends on the information in the PFX, but the directories used in 99.99% of all PFX loads are documented at docs.microsoft/en-us/windows/win32/seccng/key-storage-and-retrieval#key-directories-and-files.

(在0.01%的情况下,PFX内容表示将密钥加载到使用其他位置的其他存储提供程序中.)

(In the 0.01% case, the PFX contents say to load the key into some other storage provider which uses some other location.)

或者,除非您要执行一些需要命名键的操作之一,否则在加载PFX时指定 EphemeralKeySet .

Or, unless you're doing one of the few things that require named keys, specify EphemeralKeySet when loading the PFX.

更多推荐

X509Certificate2构造函数抛出Internal.Cryptography.CryptoThrowHelper + WindowsCryptogra

本文发布于:2023-11-16 19:42:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607197.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:抛出   磁盘   没有足够   函数   空间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!