1. Preparing data in this directory
Do not use OpenSSL 3.0.0. The default algorithms for pkcs12 are changed.
(
mkdir tmp
cd tmp
keytool -keystore ks -keyalg ec -genkeypair -storepass changeit -alias a -dname CN=A
openssl pkcs12 -in ks -nodes -out kandc -passin pass:changeit
openssl pkcs12 -export -in kandc -out os2 -name a -passout pass:changeit \
-certpbe NONE -nomac
openssl pkcs12 -export -in kandc -out os3 -name a -passout pass:changeit \
-certpbe NONE
openssl pkcs12 -export -in kandc -out os4 -name a -passout pass:changeit \
-certpbe PBE-SHA1-RC4-128 -keypbe PBE-SHA1-RC4-128 -macalg SHA224
openssl pkcs12 -export -in kandc -out os5 -name a -passout pass:changeit \
-certpbe AES-256-CBC -keypbe AES-256-CBC -macalg SHA512
for a in *; do
openssl base64 -in $a -out ../$a
done
cd ..
rm -rf tmp
)
2. After running the test, we can go to the scratch directory and run the
following commands to check keytool -> openssl interoperability.
OpenSSL 1.1.0i is used here. Earlier versions might generate different info.