openssl命令小解


# apt-get install openssl        (debian)

# yum install openssl            (centos)

# emerge openssl                (gentoo)


# cd openssl-1.0.1e

# ./configure --prefix=/usr/local/openssl

# cd /usr/local/openssl

# find . -name CA*

# ln /usr/loca..../CA.sh /sbin/ca

# chmod 755 /sbin/ca

================================


生成密钥(rsa 密钥)

生成非对称密码对之私钥

    # openssl genrsa -out server.key

生成私钥的公钥

    # openssl rsa -in server.key -pubout -out server.pub

查看私钥

    # openssl rsa -in server.key

查看公钥

    # openssl rsa -in server.key -pubout

使用已创建的RSA密钥文件创建一个自签名的X509证书

    # openssl req -new -x509 -nodes -sha1 -days 365 -key server.key -out server.crt



生成证书

# openssl genrsa -out hhh.key

    生成密钥    wKiom1ON6BOggsX1AAAUOX1hbpg110.jpg

# openssl req -new -key hhh.key -out hhh.csr

    生成证书    wKioL1ON6E7jQ4cQAAAXYRUg1PQ019.jpg

    “证书签署请求CSR”

# openssl ca -in client.csr -out client.crt

    签发证书

# openssl x509 -req -days 365 -in hhh.csr -signkey hhh.key -out hhh.crt

    生成x509自签名证书




你可能感兴趣的:(证书,local,密码,emerge)