private static void ValidateCryptoKey(ConDepOptions options) { if (string.IsNullOrWhiteSpace(options.CryptoKey)) { return; } if (!JsonPasswordCrypto.ValidKey(options.CryptoKey)) { throw new ConDepCmdParseException( "Decryption key not valid. Key must be base64 encoded and 128, 192 or 256 bits long."); } }
public override void Validate(ConDepDecryptOptions options) { if (string.IsNullOrWhiteSpace(options.Key)) { throw new ConDepValidationException("Decryption key not provided."); } if (!JsonPasswordCrypto.ValidKey(options.Key)) { throw new ConDepCmdParseException( "Decryption key not valid. Key must be base64 encoded and 128, 192 or 256 bits long."); } }