* ignore whitespaces so you can copy&paste signatures better

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5828 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 16 years ago
parent fadf311b97
commit d93a2a6552

@ -730,7 +730,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
try {
String publicKeyString = getConfig("network.unit.update.location" + i + ".key", null);
if(publicKeyString != null) {
byte[] publicKeyBytes = Base64Order.standardCoder.decode(publicKeyString, "decode public Key");
byte[] publicKeyBytes = Base64Order.standardCoder.decode(publicKeyString.trim(), "decode public Key");
publicKey = cryptoLib.getPublicKeyFromBytes(publicKeyBytes);
}
} catch (InvalidKeySpecException e) {

@ -155,14 +155,14 @@ public class CryptoLib {
CryptoLib cl = new CryptoLib();
serverCharBuffer pubKeyBuffer = new serverCharBuffer(new File(args[1]));
byte[] pubKeyByteBuffer = Base64Order.standardCoder.decode(
pubKeyBuffer.toString(), "Private Key");
pubKeyBuffer.toString().trim(), "Private Key");
PublicKey pubKey = cl.getPublicKeyFromBytes(pubKeyByteBuffer);
FileInputStream dataStream = new FileInputStream(args[2]);
serverCharBuffer signBuffer = new serverCharBuffer(new File(args[2] + ".sig"));
byte[] signByteBuffer = Base64Order.standardCoder.decode(
signBuffer.toString(), "Signature");
signBuffer.toString().trim(), "Signature");
if(cl.verifySignature(pubKey, dataStream, signByteBuffer)) {
System.out.println("Signature OK!");
} else {

@ -394,7 +394,7 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
return null;
}
try {
signatureBytes = Base64Order.standardCoder.decode(new String(signatureData, "UTF8"), "decode signature");
signatureBytes = Base64Order.standardCoder.decode(new String(signatureData, "UTF8").trim(), "decode signature");
} catch (UnsupportedEncodingException e) {
Log.logSevere("yacyVersion", "download of signature " + this.url.toString() + " failed: unsupported encoding");
return null;

Loading…
Cancel
Save