简体   繁体   English

如何使用 DocuSign 生成的公钥和私钥生成 .jks 文件

[英]How to generate the .jks file with the DocuSign generated Public key & private key

I have public key & private key with me.我有公钥和私钥。 These keys are generated by the DocuSign backend itself.这些密钥由 DocuSign 后端本身生成。 Now I need to generate the .jks file out of it to use in my application.现在我需要从中生成.jks文件以在我的应用程序中使用。 I only have a public key & a private key.我只有一个公钥和一个私钥。 I don't have any certificate provided by DocuSign.我没有 DocuSign 提供的任何证书。 I tried a lot using commands like:我使用以下命令尝试了很多:

  1. openssl req -x509 -sha256 -nodes -days 1000 -newkey rsa:2048 -keyout kmat_wmio.key -out kmat_wmio.crt (generates private and public key pair) openssl req -x509 -sha256 -nodes -days 1000 -newkey rsa:2048 -keyout kmat_wmio.key -out kmat_wmio.crt (生成私钥和公钥对)

  2. openssl pkcs12 -export -in kmat_wmio.crt -inkey kmat_wmio.key -out kmat_wmio.p12 (Keystore in PKCS12 format) openssl pkcs12 -export -in kmat_wmio.crt -inkey kmat_wmio.key -out kmat_wmio.p12 (PKCS12格式的密钥库)

  3. keytool -importkeystore -srckeystore kmat_wmio.p12 -srcstoretype PKCS12 -destkeystore kmat_wmio.jks -deststoretype JKS (Keystore in JKS format) keytool -importkeystore -srckeystore kmat_wmio.p12 -srcstoretype PKCS12 -destkeystore kmat_wmio.jks -deststoretype JKS (JKS 格式的密钥库)

But these commands didn't help much.但是这些命令并没有多大帮助。 They generate the new public & private key.他们生成新的公钥和私钥。 But I need to generate the .jks file with the existing public & private key.但我需要使用现有的公钥和私钥生成.jks文件。 Please suggest the suitable guideline or correct commands for the same.请建议合适的指南或正确的命令。

Now i need to generate the .jks file out of it, to use in my application.现在我需要从中生成 .jks 文件,以在我的应用程序中使用。

I'm not clear why you need this.我不清楚你为什么需要这个。 The private key is used for JWT Authentication and is a text file format.私钥用于 JWT 身份验证,是一种文本文件格式。 You don't need another file, you can use it as-is with Java to make API calls using JWT.您不需要其他文件,您可以按原样与 Java 一起使用它来使用 JWT 进行 API 调用。 I would suggest you use the Java package (SDK) that has built-in wrappers that just take the private key and a few other pieces of information and get you an access token to make API calls.我建议您使用具有内置包装器的Java 包(SDK),这些包装器仅获取私钥和​​其他一些信息,并为您提供访问令牌以进行 API 调用。

Easier still would be to download theJava quickstart which includes all the code you need to make eSign API calls with DocuSign using Java.更简单的方法是下载Java 快速入门,其中包含使用 Java 通过 DocuSign 进行 eSign API 调用所需的所有代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM