public ByteString[] SignByteStrings(IUser[] users, params ByteString[] bs) { if (bs == null) { return(null); } if (bs.Length == 0) { return(null); } if (bs.Length == 1 && bs[0] == null) { return(null); } byte[] signbytes = new byte[bs.Sum(a => a.Length)]; int start = 0; foreach (ByteString b in bs) { Array.Copy(b.ToByteArray(), 0, signbytes, start, b.Length); start += b.Length; } ByteString[] ret = new ByteString[users.Length]; int ii = -1; foreach (IUser user in users) { // Get the signing identity from the user ISigningIdentity si = IdentityFactory.GetSigningIdentity(CryptoPrimitives, user); // generate signature ret[++ii] = ByteString.CopyFrom(si.Sign(signbytes)); } return(ret); }
public byte[] Sign(byte[] b) { return(signingIdentity.Sign(b)); }