예제 #1
0
파일: DH.cs 프로젝트: waffle-iron/nequeo
 /// <summary>
 /// Calls DH_generate_parameters_ex()
 /// </summary>
 /// <param name="primeLen"></param>
 /// <param name="generator"></param>
 /// <param name="callback"></param>
 /// <param name="arg"></param>
 public DH(int primeLen, int generator, BigNumber.GeneratorHandler callback, object arg)
     : base(Native.ExpectNonNull(Native.DH_new()), true)
 {
     this.thunk = new BigNumber.GeneratorThunk(callback, arg);
     Native.ExpectSuccess(Native.DH_generate_parameters_ex(
                              this.ptr,
                              primeLen,
                              generator,
                              this.thunk.CallbackStruct)
                          );
 }
예제 #2
0
파일: DSA.cs 프로젝트: wlasser/D3Emu
 /// <summary>
 /// Calls DSA_new() then DSA_generate_parameters_ex()
 /// </summary>
 /// <param name="bits"></param>
 /// <param name="callback"></param>
 /// <param name="arg"></param>
 public DSA(int bits, BigNumber.GeneratorHandler callback, object arg)
     : base(Native.ExpectNonNull(Native.DSA_new()), true)
 {
     this.thunk = new BigNumber.GeneratorThunk(callback, arg);
     Native.ExpectSuccess(Native.DSA_generate_parameters_ex(
                              this.ptr,
                              bits,
                              null, 0,
                              out this.counter,
                              out this.h,
                              this.thunk.CallbackStruct)
                          );
 }
예제 #3
0
        /// <summary>
        /// Calls DSA_new() then DSA_generate_parameters_ex()
        /// </summary>
        /// <param name="bits"></param>
        /// <param name="seed"></param>
        /// <param name="counter"></param>
        /// <param name="callback"></param>
        /// <param name="arg"></param>
        public DSA(int bits, byte[] seed, int counter, BigNumber.GeneratorHandler callback, object arg)
            : base(Native.ExpectNonNull(Native.DSA_new()), true)
        {
            this.counter = counter;
            thunk        = new BigNumber.GeneratorThunk(callback, arg);

            Native.ExpectSuccess(Native.DSA_generate_parameters_ex(
                                     ptr,
                                     bits,
                                     seed, seed.Length,
                                     out this.counter,
                                     out h,
                                     thunk.CallbackStruct)
                                 );
        }
예제 #4
0
 /// <summary>
 /// Calls RSA_generate_key_ex()
 /// </summary>
 /// <param name="bits"></param>
 /// <param name="e"></param>
 /// <param name="callback"></param>
 /// <param name="arg"></param>
 public void GenerateKeys(int bits, BigNumber e, BigNumber.GeneratorHandler callback, object arg)
 {
     thunk = new BigNumber.GeneratorThunk(callback, arg);
     Native.ExpectSuccess(Native.RSA_generate_key_ex(ptr, bits, e.Handle, thunk.CallbackStruct));
 }
예제 #5
0
파일: DSA.cs 프로젝트: Nangal/http2-katana
		/// <summary>
		/// Calls DSA_new() then DSA_generate_parameters_ex()
		/// </summary>
		/// <param name="bits"></param>
		/// <param name="seed"></param>
		/// <param name="counter"></param>
		/// <param name="callback"></param>
		/// <param name="arg"></param>
		public DSA(int bits, byte[] seed, int counter, BigNumber.GeneratorHandler callback, object arg)
			: base(Native.ExpectNonNull(Native.DSA_new()), true)
		{
			this.counter = counter;
			this.thunk = new BigNumber.GeneratorThunk(callback, arg);
			Native.ExpectSuccess(Native.DSA_generate_parameters_ex(
				this.ptr,
				bits,
				seed, seed.Length,
				out this.counter,
				out this.h,
				this.thunk.CallbackStruct)
			);
		}
예제 #6
0
파일: DSA.cs 프로젝트: yaobos/openssl-net
		/// <summary>
		/// Calls DSA_new() then DSA_generate_parameters_ex()
		/// </summary>
		/// <param name="bits"></param>
		/// <param name="callback"></param>
		/// <param name="arg"></param>
		public DSA(int bits, BigNumber.GeneratorHandler callback, object arg)
			: base(Native.ExpectNonNull(Native.DSA_new()), true)
		{
			thunk = new BigNumber.GeneratorThunk(callback, arg);

			Native.ExpectSuccess(Native.DSA_generate_parameters_ex(
				ptr,
				bits,
				null, 0,
				out counter,
				out h,
				thunk.CallbackStruct)
			);
		}
예제 #7
0
파일: DH.cs 프로젝트: yaobos/openssl-net
		/// <summary>
		/// Calls DH_generate_parameters_ex()
		/// </summary>
		/// <param name="primeLen"></param>
		/// <param name="generator"></param>
		/// <param name="callback"></param>
		/// <param name="arg"></param>
		public DH(int primeLen, int generator, BigNumber.GeneratorHandler callback, object arg)
			: base(Native.ExpectNonNull(Native.DH_new()), true)
		{
			thunk = new BigNumber.GeneratorThunk(callback, arg);
			Native.ExpectSuccess(Native.DH_generate_parameters_ex(
				ptr,
				primeLen,
				generator,
				thunk.CallbackStruct)
			);
		}
예제 #8
0
		/// <summary>
		/// Calls RSA_generate_key_ex()
		/// </summary>
		/// <param name="bits"></param>
		/// <param name="e"></param>
		/// <param name="callback"></param>
		/// <param name="arg"></param>
		public void GenerateKeys(int bits, BigNumber e, BigNumber.GeneratorHandler callback, object arg)
		{
			thunk = new BigNumber.GeneratorThunk(callback, arg);
			Native.ExpectSuccess(Native.RSA_generate_key_ex(ptr, bits, e.Handle, thunk.CallbackStruct));
		}