public String deserialize(String password, String encryptedPassword, Validatable config) {
        if (isNotBlank(password) && isNotBlank(encryptedPassword)) {
            config.addError(PASSWORD, "You may only specify `password` or `encrypted_password`, not both!");
            config.addError(ScmMaterialConfig.ENCRYPTED_PASSWORD, "You may only specify `password` or `encrypted_password`, not both!");
        }

        if (isNotBlank(password)) {
            try {
                return goCipher.encrypt(password);
            } catch (CryptoException e) {
                config.addError(PASSWORD, "Could not encrypt the password. This usually happens when the cipher text is invalid");
            }
        } else if (isNotBlank(encryptedPassword)) {
            try {
                goCipher.decrypt(encryptedPassword);
            } catch (Exception e) {
                config.addError(ENCRYPTED_PASSWORD, "Encrypted value for password is invalid. This usually happens when the cipher text is invalid.");
            }

            return encryptedPassword;
        }
        return null;
    }
@Test
    public void shouldReturnTheEncryptedPasswordSentByUserIfValid() throws CryptoException {
        String encryptedPassword = new GoCipher().encrypt("password");
        SvnMaterialConfig svnMaterialConfig = svn();
        PasswordDeserializer passwordDeserializer = new PasswordDeserializer();
        String encrypted = passwordDeserializer.deserialize(null, encryptedPassword, svnMaterialConfig);
        assertThat(encrypted, is(encryptedPassword));
    }