ozone: Handle pressure and tilt for stylus devices
[chromium-blink-merge.git] / net / data / ssl / scripts / generate-android-test-keys.sh
blob1c297e3a86fc3ff6064e40e58c3ef5704efb1e09
1 #!/bin/sh
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # This script is used to generate the test keys for the unit test in
8 # android/keystore_unittest.c.
10 # These are test RSA / DSA / ECDSA private keys in PKCS#8 format, as well
11 # as the corresponding DSA / ECDSA public keys.
14 # Exit script as soon a something fails.
15 set -e
17 mkdir -p out
18 rm -rf out/*
20 # Generate a single 2048-bits RSA private key in PKCS#8 format.
21 KEY=android-test-key-rsa
22 openssl genrsa \
23 -out out/$KEY.pem \
24 2048
26 # Generate a 2048-bits DSA private key in PKCS#8 format,
27 # as well as its public key in X.509 DER format.
28 KEY=android-test-key-dsa
29 openssl dsaparam \
30 -out out/$KEY.param.pem \
31 2048
33 openssl gendsa \
34 -out out/$KEY.pem \
35 out/$KEY.param.pem
37 openssl dsa \
38 -in out/$KEY.pem \
39 -outform PEM \
40 -out out/$KEY-public.pem \
41 -pubout
43 rm out/$KEY.param.pem
45 # Generate an ECDSA private key, in PKCS#8 format,
46 # as well as its public key in X.509 DER format.
47 KEY=android-test-key-ecdsa
48 openssl ecparam -genkey -name prime256v1 -out out/$KEY.pem
50 openssl ec \
51 -in out/$KEY.pem \
52 -outform PEM \
53 -out out/$KEY-public.pem \
54 -pubout
56 # We're done here.