下载链接encodedKeyStore [英] Download link encodedKeyStore

查看:114
本文介绍了下载链接encodedKeyStore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过一个API生成了一个PKCS12密钥库,但返回的过程是一个KeyStore对象。我需要将其发送到客户端发送请购单时要下载的浏览器。



我该怎么做?



我使用java和jboss 5AS。

解决方案

你可以使用 KeyStore#store() 将其写入 OutputStream

  keyStore.store(outputStream,password); 

基本上是这样 OutputStream 可能是HTTP响应之一。对于如何在JSF中提供文件下载的通用开始示例,您需要集成此行,请回到以下答案:如何从JSF备份bean提供文件下载?使用内容类型 application / x-pkcs12


I've been generated a PKCS12 keystore through a API, but the return of the process is a KeyStore object. I need to send it, directly to the browser to be downloaded when the client send the requisition.

How can I do that?

I'm using java and jboss 5AS.

解决方案

You can use KeyStore#store() to write it out to an OutputStream.

keyStore.store(outputStream, password);

That's basically it. The OutputStream could be the one of the HTTP response. For a generic kickoff example of how to provide a file download in JSF wherein you need to integrate this line, head to this answer: How to provide a file download from a JSF backing bean? Use a content type of application/x-pkcs12.

这篇关于下载链接encodedKeyStore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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