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
|
||||
*
|
||||
* @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<DigitalSignature> 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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue