1 This is a static file don't change the content, it is used in the test 2 3 #!/bin/sh 4 # 5 # Copyright (c) 2005 Kungliga Tekniska Hgskolan 6 # (Royal Institute of Technology, Stockholm, Sweden). 7 # All rights reserved. 8 # 9 # Redistribution and use in source and binary forms, with or without 10 # modification, are permitted provided that the following conditions 11 # are met: 12 # 13 # 1. Redistributions of source code must retain the above copyright 14 # notice, this list of conditions and the following disclaimer. 15 # 16 # 2. Redistributions in binary form must reproduce the above copyright 17 # notice, this list of conditions and the following disclaimer in the 18 # documentation and/or other materials provided with the distribution. 19 # 20 # 3. Neither the name of the Institute nor the names of its contributors 21 # may be used to endorse or promote products derived from this software 22 # without specific prior written permission. 23 # 24 # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 25 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 28 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 # SUCH DAMAGE. 35 # 36 # 37 38 srcdir="@srcdir@" 39 40 echo "try printing" 41 ./hxtool print \ 42 --pass=PASS:foobar \ 43 PKCS12:$srcdir/data/test.p12 || exit 1 44 45 echo "make sure entry is found (friendlyname)" 46 ./hxtool query \ 47 --pass=PASS:foobar \ 48 --friendlyname=friendlyname-test \ 49 PKCS12:$srcdir/data/test.p12 || exit 1 50 51 echo "make sure entry is not found (friendlyname)" 52 ./hxtool query \ 53 --pass=PASS:foobar \ 54 --friendlyname=friendlyname-test-not \ 55 PKCS12:$srcdir/data/test.p12 && exit 1 56 57 echo "check for ca cert (friendlyname)" 58 ./hxtool query \ 59 --pass=PASS:foobar \ 60 --friendlyname=ca \ 61 PKCS12:$srcdir/data/test.p12 || exit 1 62 63 echo "make sure entry is not found (friendlyname)" 64 ./hxtool query \ 65 --pass=PASS:foobar \ 66 --friendlyname=friendlyname-test \ 67 PKCS12:$srcdir/data/sub-cert.p12 && exit 1 68 69 echo "make sure entry is found (friendlyname|private key)" 70 ./hxtool query \ 71 --pass=PASS:foobar \ 72 --friendlyname=friendlyname-test \ 73 --private-key \ 74 PKCS12:$srcdir/data/test.p12 || exit 1 75 76 echo "make sure entry is not found (friendlyname|private key)" 77 ./hxtool query \ 78 --pass=PASS:foobar \ 79 --friendlyname=ca \ 80 --private-key \ 81 PKCS12:$srcdir/data/test.p12 && exit 1 82 83 exit 0 84 85