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

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

public Init ( bool forEncryption, ICipherParameters parameters ) : void
forEncryption bool
parameters ICipherParameters
Результат void
		public void Init(
			bool				forEncryption,
			ICipherParameters	parameters)
		{
			if (parameters is ParametersWithRandom)
			{
				parameters = ((ParametersWithRandom) parameters).Parameters;
			}

			if (!(parameters is RsaKeyParameters))
				throw new InvalidKeyException("Not an RSA key");

			this.key = (RsaKeyParameters) parameters;
			this.forEncryption = forEncryption;
			this.bitSize = key.Modulus.BitLength;
		}

Usage Example

Пример #1
0
 public virtual void Init(bool forEncryption, ICipherParameters parameters)
 {
     if (core == null)
     {
         core = new RsaCoreEngine();
     }
     core.Init(forEncryption, parameters);
 }
All Usage Examples Of Org.BouncyCastle.Crypto.Engines.RsaCoreEngine::Init