In law, an affirmation is a solemn declaration allowed to those who conscientiously
object to taking an oath. An affirmation has exactly the same legal effect
as an oath. "I do solemnly sincerely and truly declare and affirm
that the evidence I shall give be the truth, the whole truth and nothing
but the truth" could take place of an oath.
To affirm is to solemnly declare the truth of a matter, or an ability to
testify truthfully. An affirmation is given in the place of an oath when
the witness has some objection to taking an oath, for example, a Jehovah's
Witness would make an affirmation as opposed to solemnly swearing to tell
the truth, the whole truth and nothing but the truth.
Affirming and swearing have the same legal effect. So a person who lies
on the stand after affirming that they would tell the truth would perjure
him or herself.