Sign RSA XML Key

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
MR0808
Forum Newbie
Posts: 1
Joined: Mon Apr 11, 2011 12:09 am

Sign RSA XML Key

Post by MR0808 »

Hi,

We currently have an RSA key in XML format, and am trying to sign it with PHP and phpseclib, however we are struggling to do it. We have managed to decrypt and encrypt it, but can not find a way to sign it. They key has been generated with .NET.

Cheers
mdraut
Forum Newbie
Posts: 1
Joined: Fri May 23, 2014 2:26 pm

Re: Sign RSA XML Key

Post by mdraut »

$xml->loadXML($privatekey2); //this you must have already done
$d = new Math_BigInteger(base64_decode($xml->getElementsByTagName('D')->item(0)->nodeValue), 256); // this you have alredy done
$rsa->exponent = $d; // but this must be missing from your code
Post Reply