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