Does "identity" mean the same thing in these two sentences?

You can lose your identity when you join the army.

It was too dark to determine his identity.
different meanings