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

    一、简介

    rsautl指令能够使用RSA算法签名,验证身份,加密/解密数据

    二、语法

    openssl rsautl [-in file] [-out file] [-inkey file] [-passin arg] [-keyform PEM|DER|NET] [-pubin] [-certin]
    [-asn1parse] [-hexdump] [-raw] [-oaep] [-ssl] [-pkcs] [-x931] [-sign] [-verify][-encrypt] [-decrypt] [-rev] 
    [-engine e]

    选项

    -in file        input file
    -out file       output file
    -inkey file     input key
    -keyform arg    private key format - default PEM
    -pubin          input is an RSA public
    -certin         input is a certificate carrying an RSA public key
    -ssl            use SSL v2 padding
    -raw            use no padding
    -pkcs           use PKCS#1 v1.5 padding (default)
    -oaep           use PKCS#1 OAEP
    -sign           sign with private key
    -verify         verify with public key
    -encrypt        encrypt with public key
    -decrypt        decrypt with private key
    -hexdump        hex dump output
    -engine e       use engine e, possibly a hardware device.
    -passin arg    pass phrase source

    三、实例

    1、签名验签

    openssl rsautl -sign -inkey prikey.pem -passin pass:123456 -in test.txt -out test_sign.msg
    openssl rsautl -verify -inkey pubkey.pem -pubin -passin pass:123456 -in test_sign.msg

    image

    2、加密解密

    openssl rsautl -encrypt -pubin -inkey pubkey.pem -in test.txt -out test_cipher.txt
    openssl rsautl -decrypt -inkey prikey.pem -passin pass:123456 -in test_cipher.txt

    image

  • 相关阅读:
    B-线性代数-距离公式汇总
    B-线性代数-范数
    B-线性代数-矩阵转置
    B-概率论-贝叶斯决策
    B-概率论-极大似然估计
    B-概率论-条件概率
    2018.1.7java转型
    追求
    面向心态
    数据类型和type函数
  • 原文地址:https://www.cnblogs.com/274914765qq/p/4675535.html
Copyright © 2011-2022 走看看