zoukankan      html  css  js  c++  java
  • openssl创建使用中级证书实例

    1.签发根CA
           openssl genrsa -des3 -out myrootca.key 1024
          openssl req -new -key myrootca.key -out myrootca.req
          openssl x509 -req -days 7305 -extfile rootca.conf -signkey myrootca.key -in myrootca.req -out myrootca.crt
    2.签发中级CA
      openssl genrsa -out subca.key 1024
        openssl req -new -key subca.key -out subca.req
            openssl x509 -req -days 3650 -sha1 -extfile subca.conf -CA myrootca.crt -CAkey myrootca.key -CAserial myrootca.srl -CAcreateserial -in subca.req -out subca.crt
    1.使用中级CA签发一个服务器证书

    openssl x509 -req -days 3650 -sha1 -extfile server.conf -CA subca.crt -CAkey subca.key -CAserial subca.srl -CAcreateserial -in certreq.txt -out serverbysubca.crt

    1.使用根CA签发一个服务器证书
    openssl x509 -req -days 3650 -sha1 -extfile server.conf -CA myrootca.crt -CAkey myrootca.key -CAserial myrootca.srl -CAcreateserial -in myhost.req -out myhost.crt


    rootca.conf:

    basicConstraints = CA:true
    keyUsage = keyCertSign, cRLSign


    subca.conf

    basicConstraints = CA:true,pathlen:0

    keyUsage = keyCertSign, cRLSign

    nsCertType = sslCA, emailCA, objCA


    server.conf

    basicConstraints = CA:false

    keyUsage=digitalSignature,keyEncipherment,dataEncipherment, keyAgreement

    nsCertType = server

    extendedKeyUsage = serverAuth, msSGC, nsSGC

  • 相关阅读:
    数据库事务的四个隔离级别浅析
    Spring事务管理之几种方式实现事务
    SQL调优简介及调优方式
    Spring MVC工作流程图
    java中的垃圾回收机
    iOS 本地化-国际化-(App名字国际化)
    iOS-自建iPa应用分发平台
    稳定App缓存
    iOS-保存图片到(自定义)相册步骤
    iOS -根据网络状态加载图片
  • 原文地址:https://www.cnblogs.com/jifeng/p/2053519.html
Copyright © 2011-2022 走看看