Org.BouncyCastle.Crypto.Engines.RsaCoreEngine.ConvertInput C# (CSharp) Метод

ConvertInput() публичный Метод

public ConvertInput ( byte inBuf, int inOff, int inLen ) : BigInteger
inBuf byte
inOff int
inLen int
Результат Org.BouncyCastle.Math.BigInteger
		public BigInteger ConvertInput(
			byte[]	inBuf,
			int		inOff,
			int		inLen)
		{
			int maxLength = (bitSize + 7) / 8;

			if (inLen > maxLength)
				throw new DataLengthException("input too large for RSA cipher.");

			BigInteger input = new BigInteger(1, inBuf, inOff, inLen);

			if (input.CompareTo(key.Modulus) >= 0)
				throw new DataLengthException("input too large for RSA cipher.");

			return input;
		}

Usage Example

Пример #1
0
        public virtual byte[] ProcessBlock(byte[] inBuf, int inOff, int inLen)
        {
            BigInteger bigInteger = core.ConvertInput(inBuf, inOff, inLen);

            bigInteger = ((!forEncryption) ? UnblindMessage(bigInteger) : BlindMessage(bigInteger));
            return(core.ConvertOutput(bigInteger));
        }
All Usage Examples Of Org.BouncyCastle.Crypto.Engines.RsaCoreEngine::ConvertInput