Removed the usage of DigitalSignature where should be single instace

Voter-Registry
Vladimir Eliezer Tokarev 2016-03-26 03:58:21 -07:00
parent b8cc12dfc1
commit 5398d5adc3
1 changed files with 7 additions and 8 deletions

View File

@ -18,18 +18,17 @@ public class BulletinBoardUtils {
* signed by all given DigitalSignatures * signed by all given DigitalSignatures
* *
* @param unsignedMessage BasicMessage * @param unsignedMessage BasicMessage
* @param signers collection of DigitalSignature which will sign the * @param signer DigitalSignature which will sign the UnsignedBulletinBoardMessage message
* UnsignedBulletinBoardMessage message
* @return BulletinBoardMessage * @return BulletinBoardMessage
*/ */
public static BulletinBoardMessage signBulletinBoardMessage(UnsignedBulletinBoardMessage unsignedMessage, Collection<DigitalSignature> signers) throws SignatureException { public static BulletinBoardMessage signBulletinBoardMessage(UnsignedBulletinBoardMessage unsignedMessage,
DigitalSignature signer) throws SignatureException {
BulletinBoardMessage.Builder bulletinBoardMessage = BulletinBoardMessage.newBuilder(); BulletinBoardMessage.Builder bulletinBoardMessage = BulletinBoardMessage.newBuilder();
bulletinBoardMessage.setMsg(unsignedMessage); bulletinBoardMessage.setMsg(unsignedMessage);
for (DigitalSignature signer : signers) { signer.updateContent(unsignedMessage);
signer.updateContent(unsignedMessage); Crypto.Signature signature = signer.sign();
Crypto.Signature signature = signer.sign(); bulletinBoardMessage.addSig(signature);
bulletinBoardMessage.addSig(signature);
}
return bulletinBoardMessage.build(); return bulletinBoardMessage.build();
} }