D
D
dbmaster2012-01-16 10:35:16
Java
dbmaster, 2012-01-16 10:35:16

Java - Digital Signature on Linux x64 not validated on Windows x32

There is such a problem - I sign the data array on ubuntu, and check it on windows x32.

Signature Code The dsa.verify verification code returns false. signature and verification work on the same machine. there are no exceptions. Licensee is a simple string without special characters. in theory, the architecture should not affect the signature. what could be the problem?

byte[] encodedLicenseB = license.getEncoded();
byte[] licenseeB = license.getLicensee().trim().toUpperCase().getBytes("UTF-8");
Signature dsa = Signature.getInstance("SHA1withDSA");
dsa.initSign(getPrivateKey());
dsa.update(merge(0, encodedLicenseB, licenseeB));
byte[] signature = dsa.sign();



Signature dsa = Signature.getInstance("SHA1withDSA");
dsa.initVerify(getPublicKey());

byte[] licenseeB = licensee.trim().toUpperCase().getBytes("UTF-8");
dsa.update(= merge(0, encodedLicenseB, licenseeB));
return dsa.verify(signature);





Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question