Ejemplo n.º 1
0
 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.");
     }
 }
Ejemplo n.º 2
0
        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.");
            }
        }