Skip to Content
0
Former Member
Mar 28, 2006 at 09:15 PM

verify url secKey

440 Views

Hi,

I need some help implementing a small interface for arcchive link (the http-interface). I want to verify the url using the seckey parameter and the certifiacte the sap-system supplies.

I'am using bouncycastle as security provider but I get an error. The error I get is "error decoding signature bytes". I am not sure if I have to do something with the secKey before I can start the verification.

Has anybody tried this? How do you verify the url?

Code and tipps welcome!!!

Please help.

My Code:

secKey = byte array containing the urldecoded value of the sec-key parameter

MessageDigest md5 = MessageDigest.getInstance("MD5");

byte[] hash= md5.digest(buffer);

java.security.Signature dsa2 = java.security.Signature.getInstance("SHA1withDSA", "BC");

dsa2.initVerify(certificate.getPublicKey());

dsa2.update(hash);

System.out.println("Verification: " + dsa2.verify(secKey));