From 5398d5adc3691fb431a77b8d2d63410685add140 Mon Sep 17 00:00:00 2001 From: Vladimir Eliezer Tokarev Date: Sat, 26 Mar 2016 03:58:21 -0700 Subject: [PATCH] Removed the usage of DigitalSignature where should be single instace --- .../java/meerkat/util/BulletinBoardUtils.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java b/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java index 35bcd9f..9f8b322 100644 --- a/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java +++ b/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java @@ -18,18 +18,17 @@ public class BulletinBoardUtils { * signed by all given DigitalSignatures * * @param unsignedMessage BasicMessage - * @param signers collection of DigitalSignature which will sign the - * UnsignedBulletinBoardMessage message + * @param signer DigitalSignature which will sign the UnsignedBulletinBoardMessage message * @return BulletinBoardMessage */ - public static BulletinBoardMessage signBulletinBoardMessage(UnsignedBulletinBoardMessage unsignedMessage, Collection signers) throws SignatureException { + public static BulletinBoardMessage signBulletinBoardMessage(UnsignedBulletinBoardMessage unsignedMessage, + DigitalSignature signer) throws SignatureException { BulletinBoardMessage.Builder bulletinBoardMessage = BulletinBoardMessage.newBuilder(); bulletinBoardMessage.setMsg(unsignedMessage); - for (DigitalSignature signer : signers) { - signer.updateContent(unsignedMessage); - Crypto.Signature signature = signer.sign(); - bulletinBoardMessage.addSig(signature); - } + signer.updateContent(unsignedMessage); + Crypto.Signature signature = signer.sign(); + bulletinBoardMessage.addSig(signature); + return bulletinBoardMessage.build(); }