mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-23 16:42:18 -05:00
[PR #7180] [CLOSED] option to use encrypted rsa key #23425
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/7180
Author: @pieska
Created: 5/3/2026
Status: ❌ Closed
Base:
main← Head:encrypted_rsa_key📝 Commits (1)
18a1b00add optional encryption to rsa_key.pem📊 Changes
3 files changed (+58 additions, -6 deletions)
View changed files
📝
src/auth.rs(+50 -5)📝
src/config.rs(+7 -0)📝
src/main.rs(+1 -1)📄 Description
I'm not a rust pro, but tried to implement creating/loading of encrypted rsa key:
no passphrase set, no keyfile found -> unencrypted pkcs1 created, no change
no passphrase set, key unencrypted -> key will be loaded, no change
no passphrase set, key encrypted -> error and exit
passhrase set, no keyfile found -> encrypted pkcs1 created
passphrase set, key unencrypted -> issue warnung but key will be loaded
passphrase set, key encrypted (pkcs1 or pkcs8) -> key will be loaded and decrypted
passphrase can be set in RSA_KEY_PASSPHRASE or in RSA_KEY_PASSPHRASE_FILE
encrypt existing keys:
pkcs1
openssl rsa -in rsa_key.pem -aes256 -out rsa_key_encrypted.pem -traditional
pkcs8
openssl rsa -in rsa_key.pem -aes256 -out rsa_key_encrypted.pem
check
openssl rsa -in rsa_key_encrypted.pem -check
check with passphrase file
openssl rsa -in rsa_key_encrypted.pem -check -passin file:rsa_key.pass
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.