ste*_*ios 7 certificate nss smime certificate-store certutil
我已经下载了经过验证的(非自签名)S/MIME证书和iceweasel(firefox),该证书存储在cert8.db中
然后我用了:
certutil -L -d <path_to_folder_that_cert8.db_resides>
Run Code Online (Sandbox Code Playgroud)
为了列出证书,然后我使用certutil给我的证书名称解压缩.p12文件:
pk12util -o mycertfile.p12 -n "<name_found_from_certutil>" -d <path_to_folder_that_cert8.db_resides>
Run Code Online (Sandbox Code Playgroud)
问题是我丢失了对p12存储的PC 的访问权限,现在我只有一个cert8.db拷贝到另一台PC.因此我重复了这些certutil && pk12util命令,但certutil失败了:
certutil: function failed: SEC_ERROR_LEGACY_DATABASE: The certificate/key database is in an old, unsupported format.
Run Code Online (Sandbox Code Playgroud)
我拼命尝试了3台不同的计算机,包括一台具有相同内核和libnss3-tools版本的计算机(就像我成功提取p12的初始桌面),这是:
$ uname -a
Linux commander 3.16.0-4-amd64 #1 SMP Debian 3.16.7-2 (2014-11-06) x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
libnss3-tools 版本:2:3.17.2-1
有什么想法吗?
谢谢
rjt*_*rjt 15
多年来,数据库已经从平面文件迁移到Berkeley DB,再到3.12中的SQLite.使用sql引号括起目录名称并用引号括起来以获取空格:
certutil -L -d sql:${HOME}/.pki/nssdb
Run Code Online (Sandbox Code Playgroud)
作为参考,这是Mozilla NSS路线图.
错误消息非常神秘.certutil -L用于获取cert8.db文件中的证书列表时出现类似错误.
现在我发现为什么命令不起作用.
将–L不仅能与工作cert8.db的文件夹.它还依赖于另外两个文件key3.db and secmod.db.因此,在存在所有上述3个文件的文件夹中,-L仅在那里工作.这就是–d参数采用文件夹路径的原因.不是cert8.db文件.
我通过cert8.db从Firefox配置文件文件夹复制到临时目录来尝试certutil .
当certuitl -A成功但-L失败并且成功的-A命令在该临时文件夹中创建了另外两个文件时,我注意到了它.
还要检查目录路径是否有空格.对于空间,它会出现相同的错误或"错误的文件格式错误 - 旧数据库格式"等.特别是在Mac OS中,文件"Application Support"夹位于名称中包含空格的文件夹中.所以它需要完全引用的路径:
"/Users/myuser/Library/Application Support/Firefox/Profiles/jii912uh.default"
Run Code Online (Sandbox Code Playgroud)
或者添加\ escape字符.
/Users/myuser/Library/Application\ Support/Firefox/Profiles/jii912uh.default
Run Code Online (Sandbox Code Playgroud)