zoukankan      html  css  js  c++  java
  • Openssl rsa命令

    一、简介

    Rsa命令用于处理RSA密钥、格式转换和打印信息

    二、语法

    openssl rsa [-inform PEM|NET|DER] [-outform PEM|NET|DER] [-in filename] [-passin arg] [-out filename] [-passout arg] [-sgckey] [-text] [-noout] [-modulus] [-check] [-pubin] [-pubout] [-engine id] [-des] [-des3] [-idea]

    选项

     -inform arg     input format - one of DER NET PEM
     -outform arg    output format - one of DER NET PEM
     -in arg         input file
     -sgckey         Use IIS SGC key format
     -passin arg     input file pass phrase source
     -out arg        output file
     -passout arg    output file pass phrase source
     -des            encrypt PEM output with cbc des
     -des3           encrypt PEM output with ede cbc des using 168 bit key
     -idea           encrypt PEM output with cbc idea
     -seed           encrypt PEM output with cbc seed
     -aes128, -aes192, -aes256
                     encrypt PEM output with cbc aes
     -camellia128, -camellia192, -camellia256
                     encrypt PEM output with cbc camellia
     -text           print the key in text
     -noout          don't print key out
     -modulus        print the RSA key modulus
     -check          verify key consistency
     -pubin          expect a public key in input file
     -pubout         output a public key
     -engine e       use engine e, possibly a hardware device.
     -RSAPublicKey_out 

    三、实例

    1、pem转换为der

    openssl rsa -in prikey.pem -outform der -out prikey.der

    image

    2、从私钥提取公钥

    openssl rsa -in prikey.pem -out pubkey.pem -pubout

    image

    3、查看公钥信息

    openssl rsa -pubin -in pubkey.pem -text

    image

    4、查看私钥信息

    openssl rsa -in prikey.pem -passin pass:"123456" -text

    image

    5、从证书中提取私钥

    openssl rsa -in server.pem -out serverprikey.pem

    image

  • 相关阅读:
    avalon随笔
    ms-attr-data-real-gold="{{page_data[0].gold}}" 属性付真
    jQuery 快捷操作
    jQuery 属性操作
    jQuery 表单域选中选择器
    jQuery 层次选择器
    jQuery 基本选择器
    jQuery 基本使用
    jQuery 引入多个库文件冲突
    BOM window对象方法
  • 原文地址:https://www.cnblogs.com/274914765qq/p/4668669.html
Copyright © 2011-2022 走看看