コード例 #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
ファイル: DSA.cs プロジェクト: closetoyou293/xamarin.openssl
        /// <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
ファイル: RSA.cs プロジェクト: chang892886597/openssl-net
		/// <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));
		}