将 SAN 添加到 SSL 证书(在 Java 中) [英] Adding an SAN to an SSL cert (in Java)

查看:52
本文介绍了将 SAN 添加到 SSL 证书(在 Java 中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个设置了 SAN 字段(主题备用名称)的自签名证书,但 Java keytool 工具似乎不支持.我最好的选择是什么?这是供 Java 使用的,因此即使使用非 Java 工具创建证书,密钥库仍必须匹配 JKS 格式.

I want to create a self-signed cert with the SAN field (subject alternative name) set but the Java keytool tool does not seem to support that. What is my best option? This is for Java use, so the keystore must still match the JKS format even if a non-Java tool is used to create the cert.

推荐答案

JDK7 的建议很好.与此同时,我能够使用 Bouncy Castle 库来做到这一点.以编程方式而不是使用 keytool 进行操作很有教育意义,并且以 jks 格式获取存储很简单.

The JDK7 suggestion is a good one. In the meantime I was able to do it using the Bouncy Castle library. It was educational to do it programmatically instead of with keytool and getting the stores in jks format was straightforward.

这篇关于将 SAN 添加到 SSL 证书(在 Java 中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆