title: How To integrate Aadhaar Card Authentication Api for Aadhaar number Verification in PHP?
body: <p>I want to integrate the Aadhaar Card Authentication API for Aadhaar number Verification in PHP. I tried <a href="https://developer.uidai.gov.in/site/book/export/html/18" rel="noreferrer">this</a> and wrote code for API access.  </p>
  
  <p>How can I generate the XML encryption field data below in PHP? <a href="https://developer.uidai.gov.in/site/node/24" rel="noreferrer">This sample code</a> is written in Java. </p>
  
  <pre><code>&lt;Auth uid="" tid="" ac="" sa="" ver="" txn="" lk=""&gt;
      &lt;Uses pi="" pa="" pfa="" bio="" bt="" pin="" otp=""/&gt;
      &lt;Tkn type="" value=""/&gt;
      &lt;Meta udc="" fdc="" idc="" pip="" lot=”G|P” lov=""/&gt;
      &lt;Skey ci="" ki=""&gt;encrypted and encoded session key&lt;/Skey&gt;
      &lt;Data type=”X|P”&gt;encrypted PID block&lt;/Data&gt;
      &lt;Hmac&gt;SHA-256 Hash of Pid block, encrypted and then encoded&lt;/Hmac&gt;
      &lt;Signature&gt;Digital signature of AUA&lt;/Signature&gt;
  &lt;/Auth&gt;
  </code></pre>