Org.BouncyCastle.Crypto.Encodings.ISO9796d1Encoding.ProcessBlock C# (CSharp) Method

ProcessBlock() public method

public ProcessBlock ( byte input, int inOff, int length ) : byte[]
input byte
inOff int
length int
return byte[]
		public byte[] ProcessBlock(
			byte[]	input,
			int		inOff,
			int		length)
		{
			if (forEncryption)
			{
				return EncodeBlock(input, inOff, length);
			}
			else
			{
				return DecodeBlock(input, inOff, length);
			}
		}

Usage Example

示例#1
0
        public virtual void DoTest3()
        {
            RsaKeyParameters pubParameters = new RsaKeyParameters(false, mod2, pub2);
            RsaKeyParameters privParameters = new RsaKeyParameters(true, mod2, pri2);
            RsaEngine rsa = new RsaEngine();
            byte[] data;

            //
            // ISO 9796-1 - public encrypt, private decrypt
            //
            ISO9796d1Encoding eng = new ISO9796d1Encoding(rsa);

            eng.Init(true, privParameters);

            eng.SetPadBits(4);

            data = eng.ProcessBlock(msg3, 0, msg3.Length);

            eng.Init(false, pubParameters);

            if (!IsSameAs(sig3, 1, data))
            {
                Fail("failed ISO9796-1 generation Test 3");
            }

            data = eng.ProcessBlock(data, 0, data.Length);

            if (!IsSameAs(msg3, 0, data))
            {
                Fail("failed ISO9796-1 retrieve Test 3");
            }
        }
All Usage Examples Of Org.BouncyCastle.Crypto.Encodings.ISO9796d1Encoding::ProcessBlock