@@ -18,8 +18,8 @@ type AppConfig struct {
1818 PlainFileExtension string
1919 BackupFileExtension string
2020 CleanPrint bool
21- DoRSA bool
22- DoAES256 bool
21+ DisableRSA bool
22+ DisableAES256 bool
2323 SubCommand string
2424 TempDecodeSeconds int
2525}
@@ -35,8 +35,8 @@ func defaultAppConfig() *AppConfig {
3535 VaultFileExtension : "vt" ,
3636 PlainFileExtension : "txt" ,
3737 CleanPrint : false ,
38- DoRSA : true ,
39- DoAES256 : true ,
38+ DisableRSA : false ,
39+ DisableAES256 : false ,
4040 SubCommand : "" ,
4141 TempDecodeSeconds : 10 ,
4242 }
@@ -60,8 +60,8 @@ func addCryptFlags(appConfig *AppConfig, cmd *cobra.Command) {
6060 cmd .Flags ().StringVarP (& appConfig .PublicKeyPath , "public-key" , "u" , appConfig .PublicKeyPath , "Defines the public key path (VAULT_PUBLIC_KEY_PATH)" )
6161 cmd .Flags ().StringVarP (& appConfig .VaultFileExtension , "vault-ext" , "e" , appConfig .VaultFileExtension , "Defines the vault file extension (VAULT_EXT)" )
6262 cmd .Flags ().StringVarP (& appConfig .PlainFileExtension , "plain-ext" , "p" , appConfig .PlainFileExtension , "Defines the plain file extension (VAULT_PLAIN_EXT)" )
63- cmd .Flags ().BoolVarP (& appConfig .DoRSA , "rsa" , "x" , appConfig .DoRSA , "Use RSA key encryption (VAULT_RSA)" )
64- cmd .Flags ().BoolVarP (& appConfig .DoAES256 , "aes" , "a" , appConfig .DoAES256 , "Use AES256 password encryption (VAULT_AES)" )
63+ cmd .Flags ().BoolVarP (& appConfig .DisableRSA , "no- rsa" , "x" , appConfig .DisableRSA , "Use RSA key encryption (VAULT_RSA)" )
64+ cmd .Flags ().BoolVarP (& appConfig .DisableAES256 , "no- aes" , "a" , appConfig .DisableAES256 , "Use AES256 password encryption (VAULT_AES)" )
6565}
6666
6767func lockCommand (appConfig * AppConfig ) * cobra.Command {
@@ -198,12 +198,20 @@ func loadEnvVars(appConfig *AppConfig) {
198198 appConfig .PlainFileExtension = value
199199 })
200200
201+ EnvIsBool ("VAULT_DISABLE_RSA" , func (value bool ) {
202+ appConfig .DisableRSA = value
203+ })
204+
201205 EnvIsBool ("VAULT_RSA" , func (value bool ) {
202- appConfig .DoRSA = value
206+ appConfig .DisableRSA = ! value
207+ })
208+
209+ EnvIsBool ("VAULT_DISABLE_AES" , func (value bool ) {
210+ appConfig .DisableAES256 = value
203211 })
204212
205213 EnvIsBool ("VAULT_AES" , func (value bool ) {
206- appConfig .DoAES256 = value
214+ appConfig .DisableAES256 = ! value
207215 })
208216
209217 EnvIsBool ("VAULT_VERBOSE" , func (value bool ) {
0 commit comments