예제 #1
0
		/// <summary>
		/// Calls PEM_write_bio_PKCS8PrivateKey
		/// </summary>
		/// <param name="bp"></param>
		/// <param name="cipher"></param>
		/// <param name="password"></param>
		public void WritePrivateKey(BIO bp, Cipher cipher, string password)
		{
			PasswordCallback callback = new PasswordCallback(password);
			WritePrivateKey(bp, cipher, callback.OnPassword, null);
		}
예제 #2
0
		/// <summary>
		/// Calls PEM_read_bio_PrivateKey()
		/// </summary>
		/// <param name="bio"></param>
		/// <param name="passwd"></param>
		/// <returns></returns>
		public static CryptoKey FromPrivateKey(BIO bio, string passwd)
		{
			var callback = new PasswordCallback(passwd);
			return FromPrivateKey(bio, callback.OnPassword, null);
		}