/// <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); }
/// <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); }