Tizen 2.0 Release
[external/libgnutls26.git] / tests / pkcs12-decode / pkcs12
1 #!/bin/sh
2
3 # Copyright (C) 2004, 2005, 2006, 2008, 2010 Free Software Foundation,
4 # Inc.
5 #
6 # Author: Simon Josefsson
7 #
8 # This file is part of GnuTLS.
9 #
10 # GnuTLS is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by the
12 # Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
14 #
15 # GnuTLS is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GnuTLS; if not, write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
24 srcdir=${srcdir:-.}
25 CERTTOOL=${CERTTOOL:-../../src/certtool}
26
27 ret=0
28 for p12 in 'client.p12 foobar' noclient.p12 unclient.p12 pkcs12_2certs.p12; do
29     set -- $p12
30     file=$1
31     passwd=$2
32     $CERTTOOL --p12-info --inder --password "$passwd" \
33                 --infile $srcdir/$file > out 2>&1
34     rc=$?
35     if test $rc != 0; then
36         cat out
37         echo "NEON PKCS12 FATAL $p12"
38         ret=1
39     else
40         echo "NEON PKCS12 OK $p12"
41     fi
42 done
43 rm -f out
44
45 echo "NEON PKCS12 DONE (rc $ret)"
46 exit $ret