I have an application signed twice using openssl smime. like shown below in a script:
SRC_FILE="my-app"
echo "signature XYZ..."
openssl smime -sign \
-in ${SRC_FILE} -binary \
-out ${SRC_FILE}.sig1 -nodetach \
-signer ${SIGN_CERT} -inkey ${SIGN_KEY}
echo "NB signature..."
openssl smime -sign \
-in ${SRC_FILE}.sig1 -binary \
-out ${SRC_FILE}.sig2 -nodetach \
-signer ${NB_SIGN_CERT} -inkey ${NB_SIGN_KEY}
I am trying to verify the signed application using :
openssl smime -verify -in ${SRC_FILE}.sig2 -CAfile ./Root_CA.crt -out ${SRC_FILE}.out
As an output of verify I am getting equivalent to ${SRC_FILE}.sig1 but my intention is to get original my-app.
If I am running verify command twice then eventually I am able to receive my-app.
I wanted to ask is there any flag which internally call recursively to produce original signed file.