mksmime-certs.sh (1.1.1.1) | mksmime-certs.sh (1.1.1.2) |
---|---|
1#!/bin/sh | 1#!/bin/sh |
2# Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. 3# 4# Licensed under the OpenSSL license (the "License"). You may not use 5# this file except in compliance with the License. You can obtain a copy 6# in the file LICENSE in the source distribution or at 7# https://www.openssl.org/source/license.html |
|
2 | 8 |
9 |
|
3# Utility to recreate S/MIME certificates 4 5OPENSSL=../../apps/openssl 6OPENSSL_CONF=./ca.cnf 7export OPENSSL_CONF 8 9# Root CA: create certificate directly 10CN="Test S/MIME RSA Root" $OPENSSL req -config ca.cnf -x509 -nodes \ --- 41 unchanged lines hidden (view full) --- 52CN="Test S/MIME EE EC #1" $OPENSSL req -config ca.cnf -nodes \ 53 -keyout smec1.pem -out req.pem -newkey ec:ecp.pem 54$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 55 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smec1.pem 56CN="Test S/MIME EE EC #2" $OPENSSL req -config ca.cnf -nodes \ 57 -keyout smec2.pem -out req.pem -newkey ec:ecp2.pem 58$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 59 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smec2.pem | 10# Utility to recreate S/MIME certificates 11 12OPENSSL=../../apps/openssl 13OPENSSL_CONF=./ca.cnf 14export OPENSSL_CONF 15 16# Root CA: create certificate directly 17CN="Test S/MIME RSA Root" $OPENSSL req -config ca.cnf -x509 -nodes \ --- 41 unchanged lines hidden (view full) --- 59CN="Test S/MIME EE EC #1" $OPENSSL req -config ca.cnf -nodes \ 60 -keyout smec1.pem -out req.pem -newkey ec:ecp.pem 61$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 62 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smec1.pem 63CN="Test S/MIME EE EC #2" $OPENSSL req -config ca.cnf -nodes \ 64 -keyout smec2.pem -out req.pem -newkey ec:ecp2.pem 65$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 66 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smec2.pem |
67CN="Test S/MIME EE EC #3" $OPENSSL req -config ca.cnf -nodes \ 68 -keyout smec3.pem -out req.pem -newkey ec:ecp.pem 69$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 70 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smec3.pem |
|
60# Create X9.42 DH parameters. 61$OPENSSL genpkey -genparam -algorithm DH -pkeyopt dh_paramgen_type:2 \ 62 -out dhp.pem 63# Generate X9.42 DH key. 64$OPENSSL genpkey -paramfile dhp.pem -out smdh.pem 65$OPENSSL pkey -pubout -in smdh.pem -out dhpub.pem 66# Generate dummy request. 67CN="Test S/MIME EE DH #1" $OPENSSL req -config ca.cnf -nodes \ 68 -keyout smtmp.pem -out req.pem -newkey rsa:2048 69# Sign request but force public key to DH 70$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 71 -force_pubkey dhpub.pem \ 72 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smdh.pem 73# Remove temp files. 74rm -f req.pem ecp.pem ecp2.pem dsap.pem dhp.pem dhpub.pem smtmp.pem smroot.srl | 71# Create X9.42 DH parameters. 72$OPENSSL genpkey -genparam -algorithm DH -pkeyopt dh_paramgen_type:2 \ 73 -out dhp.pem 74# Generate X9.42 DH key. 75$OPENSSL genpkey -paramfile dhp.pem -out smdh.pem 76$OPENSSL pkey -pubout -in smdh.pem -out dhpub.pem 77# Generate dummy request. 78CN="Test S/MIME EE DH #1" $OPENSSL req -config ca.cnf -nodes \ 79 -keyout smtmp.pem -out req.pem -newkey rsa:2048 80# Sign request but force public key to DH 81$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ 82 -force_pubkey dhpub.pem \ 83 -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smdh.pem 84# Remove temp files. 85rm -f req.pem ecp.pem ecp2.pem dsap.pem dhp.pem dhpub.pem smtmp.pem smroot.srl |