rsa-keygen.in

来自「cipe 编程」· IN 代码 · 共 51 行

IN
51
字号
#!/bin/sh##   rsa-keygen - generate an RSA public/private key pair for PKCIPE##   Copyright 2000 Olaf Titz <olaf@bigred.inka.de>##   This program is free software; you can redistribute it and/or#   modify it under the terms of the GNU General Public License#   as published by the Free Software Foundation; either version#   2 of the License, or (at your option) any later version.# $Id: rsa-keygen.in,v 1.2 2001/01/20 17:46:14 olaf Exp $openssl=@OPENSSL@umask 077if [ -z "$1" ] ; then    echo "usage: rsa-keygen [-p] name [bits]"    echo "The name is the file name _and_ the identity name."    echo "bits defaults to 1024."    echo "Use -p to set a passphrase on the private key."    exit 1fipp=falseif [ "$1" = "-p" ] ; then    pp=true    shiftfitmp=$1.tmppriv=$1.privpub=$1set -etrap "rm -f $tmp $priv $pub; trap 0; exit 1" 0 1 2 15$openssl genrsa -out $tmp ${2:-1024}$openssl rsa -pubout -out $pub -in $tmpif $pp ; then    $openssl rsa -des3 -out $priv -in $tmpelse    mv -f $tmp $privfichmod 400 $privchmod 644 $pubecho "Private key in $priv, Public key in $pub"trap "rm -f $tmp" 0exit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?