The Certainty of the Cogito

The cogito survives the doubt because it is certain, indubitable

But wherein lies the certainty?

1) deductive inference?
    -see extract from 2nd replies

2) necessary truth? denial is contradictory?

3) denial is practically self-refuting?

4) simply intuited as self-evident