title: How to print out original padded hash from signature using openssl
body: <p>I want to learn about different padding and identifier or format when signing a file. So i want to know what happens when using openssl</p>
  
  <p>For example:
  <code>openssl dgst -sha256 -sign xiaomi_rootca.key -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:-1 -out sig.bin 1.txt</code></p>
  
  <p>Surely it will generate a <code>sig.bin</code>. However i want to know what openssl did to <code>hash.bin</code> before it is converted to <code>sig.bin</code></p>
  
  <p>So let's split this process into steps:</p>
  
  <ol>
  <li><code>openssl dgst -binary -sha256 -out hash.bin 1.txt</code></li>
  <li>padding it</li>
  <li>maybe add some identifier like rfc3447.txt page 12 says? and generate a final file <code>final_hash.bin</code></li>
  <li>raw sign. <code>openssl rsautl -sign -inkey private.key -in fianl_hash.bin -out sig.bin</code></li>
  </ol>
  
  <p>Well, i want to know what happened exactly during step 2 and 3. So is there any command to reverse step 4?</p>
  
  <p>Before i can use <code>openssl rsautl -verify</code>, however it doesn't support pss pading.</p>