Cannot verify openssl smime verify over SSH -
i'm trying ssh server @ university in order openssl assignment. have self-signed certificate aasignedcert.pem
, private key signed aaprivatekey.pem
, plaintext test.txt
.
i first signed message create testsigned.txt
file command:
openssl smime -sign -signer aasignedcert.pem -in test.txt -inkey aaprivatekey.pem > testsigned.txt
then, encrypted file create testsigned.txt.enc
:
openssl smime -encrypt -in testsigned.txt -aes128 aasignedcert.pem > test.txt.enc
to create sure works, decrypted file , stored in testsigned.dec.txt
:
openssl smime -decrypt -aes128 -in test.txt.enc -inkey aaprivatekey.pem > test.dec.txt
the decrypted file indeed has original plaintext. finally, attempted verify using certificate signed with:
openssl smime -verify -in test.dec.txt -cafile aasignedcert.pem -certfile aasignedcert.pem
this, however, not work. fiddling parameters, consistently error message:
verification failure 139814549997256:error:21075075:pkcs7 routines:pkcs7_verify:certificate verify error:pk7_smime.c:342:verify error:unable local issuer certificate
i cannot figure out i'm doing wrong. have idea?
how did create aasignedcert.pem? perhaps self-signed using local ca created? if case, believe need pass the certificate of ca -cafile argument.
openssl smime -verify -in test.dec.txt -cafile [certifcate of ca] -certfile aasignedcert.pem
ssh openssl certificate verification smime
No comments:
Post a Comment