That is a strange term to apply to what was in fact the necessary act to elimination of a posed threat, created by a provacative act on the part of Major Robert Anderson, whose provacative actions of occuping Fort Sumter against the agreed deplomatic understanding between President Buchannan and Governor Picken's, which reconized such action as provacative, bordered on an act of War in the first place.
The action of occuping Fort Sumter was intended to have the same effect, on the secession of South Carolina, as President Andrew Jackson reenforcing Fort Moultrie during the 1832 South Carolina Nullification Crisis, by securing the most advantagious position for the control of Charleston Harbor. Fort Moultier could not be reenforced in 1860, as Jackson had done in 1832, IF Fort Sumter were in the hands of South Carolina (Confederate) Authorities. However if Fort Sumter could be held by Anderson, and reenforced, Charleston Harbor could not be used without the permission of those who held Fort Sumter. As the Union Navy found out in 1863 and '64 Fort Sumter would be, and was, a "hard nut" to crack.
So how do you apply the concept of "legality" or "illegality" to what was essencily a responce to an Act of War against the state of South Carolina?