Org.BouncyCastle.Crypto.Signers.PssSigner.BlockUpdate C# (CSharp) Method

BlockUpdate() public method

update the internal digest with the byte array in
public BlockUpdate ( byte input, int inOff, int length ) : void
input byte
inOff int
length int
return void
		public virtual void BlockUpdate(
			byte[]	input,
			int		inOff,
			int		length)
		{
			contentDigest1.BlockUpdate(input, inOff, length);
		}

Usage Example

示例#1
0
        private void doTestSig(
			int					id,
			RsaKeyParameters	pub,
			RsaKeyParameters	prv,
			byte[]				slt,
			byte[]				msg,
			byte[]				sig)
        {
            PssSigner eng = new PssSigner(new RsaEngine(), new Sha1Digest(), 20);

            eng.Init(true, new ParametersWithRandom(prv, new FixedRandom(slt)));

            eng.BlockUpdate(msg, 0, msg.Length);

            byte[] s = eng.GenerateSignature();

            if (!AreEqual(s, sig))
            {
                Fail("test " + id + " failed generation");
            }

            eng.Init(false, pub);

            eng.BlockUpdate(msg, 0, msg.Length);

            if (!eng.VerifySignature(s))
            {
                Fail("test " + id + " failed verification");
            }
        }
All Usage Examples Of Org.BouncyCastle.Crypto.Signers.PssSigner::BlockUpdate