Removed the usage of DigitalSignature where should be single instace
parent
b8cc12dfc1
commit
5398d5adc3
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue