#
# NSS Provider - test store utility with "cert" URI
# Remark: store equivalent to PRINT_CERT engine command
#
# This is free software; see Copyright file in the source
# distribution for precise wording.
#
# Copyright (C) 2025 Roumen Petrov
#

nickname='E_NSS Certificate (client-'$ALGO') - E_NSS Test Team cyrillic-АБВ-Яабв-я greek-ΑΒΓ-Ωαβγ-ω'

file=sto-cert-$ALGO

$OPENSSL storeutl -text -passin $nsspass "$SCHEME:cert=$nickname" \
> $file.out 2> $file.err

(
set -e
grep '0: Certificate' $file.out
grep 'Subject: .*, CN=E_NSS Certificate (client-'$ALGO')/' $file.out
grep '^-----END CERTIFICATE-----' $file.out
grep '^Total found: 1' $file.out
) > /dev/null
