数字签名:用于验证和提取认证信息的示例代码
我使用第三方工具来验证签名并从签名中获取证书详细信息(如序列号、CA 等)。该实用程序的问题是它已获得许可并且只能在某些机器上运行。
我可以使用简单的 java 或 .net 代码验证数据签名吗?(而不是使用付费应用程序)。我没有私钥来从签名数据中提取证书信息。
或者,如果我有 pfx 文件,有人可以建议 java 或 .net 中的示例代码来提取证书详细信息。来自签名数据。
数据使用非对称加密进行签名。
I use a third party tool to verify signature and to get certificate detail(like serial number, CA etc..) from signature. The problem with this utility is it is licensed and works on certain machines only.
Can i validate the signature against the data using simple java or .net code?(instead of using paid application). I dont have private key to extract certificate information from signed data.
Or if someone can suggest sample code in java or .net to extract certificate detail if i have pfx file. Of from signed data.
Data is signed with asymmetric encryption.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要从证书中提取详细信息:
-----BEGIN CERTIFICATE-----
,结尾有-----END CERTIFICATE-----
即可。<代码>
<代码>
To extract detail from certificate:
-----BEGIN CERTIFICATE-----
in starting and-----END CERTIFICATE-----
in end.如果您有 PFX 文件,那么它可能包含验证签名所需的公钥证书。
或者,如果您的签名是 PKCS#7 签名,则签名本身将保存数据、签名和证书。假设 PKCS#7 未分离。
您需要询问您的签名者,他如何传输他的证书进行验证。
If you are having the PFX file, then that may contain the public key certificate which will be required to verify the signature.
Alternatively, if your signature is a PKCS#7 signature, then the signature itself will hold the data, signature and the certificate. Assuming PKCS#7 is not detached.
You need to ask your signer, how is he transferring his certificate for validation.