RSA Sign Base64 value

41 Aufrufe
Direkt zur ersten ungelesenen Nachricht

jon

ungelesen,
28.09.2009, 16:28:4328.09.09
an As3Crypto Discussion List
Hi All,

I'm having some troubles matching the value returned from RSA signing
a Base64 SHA1 hash with the result return in c#.

I'm passing in a Base64 hash decoded as a byte array to the sign()
function provided in as3crypto and base64 encoding the result.
However, this result never matches the returned result from a c#
function which performs the same task. Does it matter that the
function takes in and return hex even though it works at the byte
array level?

Please see my below signing function to check i haven't missed
anything!


private function signHash(hashInBase64:String):String
{
var src:ByteArray = Base64.decodeToByteArray(hashInBase64);
var key:RSAKey = RSAKey.parsePrivateKey(getModulus(), getExponent(),
getPrivate(), getP(), getQ(), getDMP1(), getDMQ1(), getCoeff());
var dst:ByteArray = new ByteArray();

key.sign(src, dst, src.length);

return Base64.encodeByteArray(dst);
}


Any help would be great!!!


Thanks,

Jon
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten