The Confederate Congress declared war on the United States on May 6, 1861. However, it specifically excluded a declaration of war against states and territories that it claimed to be part of the southern confederacy (outside of Tennessee and North Carolina which had not yet seceded.) These included the territories of Arizona, New Mexico, and so-called Indian Territory. This would appear to provide the confederacy with legal justification for carrying out military operations in those areas. But as seen in the Confederate Constitution (below)
the Confederacy did not make any claim on California or any parts thereof.
"war exists between the Confederate States and the Government of the United States and the States and Territories thereof, except the States of Maryland, North Carolina, Tennessee, Kentucky, Arkansas, Missouri, and Delaware, and the Territories of Arizona and New Mexico, and the Indian Territory south of Kansas:"