os/security/cryptoservices/certificateandkeymgmt/tder/example/root5ca/makeall.bat
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 @rem
     2 @rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 @rem All rights reserved.
     4 @rem This component and the accompanying materials are made available
     5 @rem under the terms of the License "Eclipse Public License v1.0"
     6 @rem which accompanies this distribution, and is available
     7 @rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 @rem
     9 @rem Initial Contributors:
    10 @rem Nokia Corporation - initial contribution.
    11 @rem
    12 @rem Contributors:
    13 @rem
    14 @rem Description: 
    15 @rem
    16 
    17 echo This script only needs to be run if you wish to modify this test data.
    18 echo Press CTRL-C to exit
    19 pause
    20 
    21 rem blank the existing CA
    22 del index.txt rand serial *.old *.attr *.pem *.req *.pk8 /S /Q
    23 echo 01 > serial
    24 type nul > index.txt
    25 
    26 set CERT_PATH=%SECURITYSOURCEDIR%\os\security\cryptomgmtlibs\securitytestfw\testcertificates\certman\tder\example\root5ca
    27 
    28 rem create a key and request
    29 rem sign the request
    30 rem revoke the signed certificate
    31 rem generate a CRL
    32 openssl genrsa -out %CERT_PATH%\ee_key.pem
    33 openssl req -config openssl_ee.config -newkey rsa:1024 -key %CERT_PATH%\ee_key.pem -out ee.req 
    34 openssl ca -config openssl.config -name Root5CA -in ee.req -extensions Signing_Extensions -extfile openssl.config -batch -out %CERT_PATH%\root5_ee.pem
    35 openssl ca -config openssl.config -name Root5CA -revoke %CERT_PATH%\root5_ee.pem -crl_reason keyCompromise
    36 openssl ca -config openssl.config -name Root5CA -gencrl -out %CERT_PATH%\root5crl.pem
    37 
    38 rem convert everything to DER
    39 openssl x509 -inform pem -outform der -in %CERT_PATH%\root5_ee.pem -out %CERT_PATH%\root5_ee.der
    40 openssl rsa -inform pem -outform der -in %CERT_PATH%\ee_key.pem -out %CERT_PATH%\ee_key.der
    41 openssl pkcs8 -topk8 -nocrypt -in ee_key.pem -outform der -out ee_key.pk8
    42 openssl crl -inform pem -outform der -in %CERT_PATH%\root5crl.pem -out %CERT_PATH%\root5crl.der