Giter VIP home page Giter VIP logo

rsa2demo's Introduction

生成RSA密钥

进入OpenSSL工具,输入以下命令:

  1. OpenSSL> genrsa -out app_private_key.pem 2048 #生成私钥
  2. OpenSSL> OpenSSL> pkcs8 -topk8 -inform PEM -in app_private_key.pem -outform PEM -nocrypt -out app_private_key_pkcs8.pem #Java开发者需要将私钥转换成PKCS8格式
  3. OpenSSL> rsa -in app_private_key.pem -pubout -out app_public_key.pem #生成公钥
  4. OpenSSL> exit #退出OpenSSL程序

经过以上步骤,可以在当前文件夹中(OpenSSL运行文件夹),看到 app_private_key.pem(开发者RSA私钥,非 Java 语言适用)、app_private_key_pkcs8.pem(pkcs8格式开发者RSA私钥,Java语言适用)和app_public_key.pem(开发者RSA公钥)3个文件。

说明:对于使用 Java 的开发者,需将生成的 pkcs8 格式的私钥去除头尾、换行和空格,作为私钥填入代码中,对于.NET和PHP的开发者来说,无需进行 pkcs8 命令行操作。

rsa2demo's People

Contributors

wuzongwen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.