Tradition, and desire for the crab meat to be as fresh and tasty as possible, demands that we cook crab alive.
Just as with lobsters, although there is no actual proof that crustaceans feel pain, many of us will blanch at the idea of cooking the creatures alive.
The most humane way of cooking live crab is to lull the crab into a state of unconsciousness prior to cooking, as explained here for lobster.
To cook crab, prepare a brine, again as with lobster - it should be as salty as sea water, and bobbing an egg in it will show you when it's salty enough (the egg will float).
When the brine is at a boil, put the crab(s) in and cook for 15 minutes for the first 500g (1 lb 2 oz), plus 10 minutes for every subsequent 500g (1 lb 2 oz).
When the time is up, lift out the crab(s) and leave to cool before handling.
See here for information on how to dress cooked crab.

Different kinds of crab and other crab information
Soft-shell crabs are blue crabs at their soft-shell stage. They're in season in the summer months - the rest of the year can be obtained frozen.