The phrase age of consent typically does not appear in legal statutes when used in relation to sexual activity. The age of consent is the minimum age at which a person is considered to be legally competent of consenting to sexual acts.
The age of consent may vary from jurisdiction to jurisdiction. It may also vary in the type of sexual act, the gender of the actors or other restrictions such as the abuse of a position of trust.
The age of consent is a legal barrier to the ability to consent. This means that obtaining consent is not in general a defense to having sexual relations with a person under the prescribed age.
Some examples of these defenses are marriage - marriageable age is less than the age of consent; rape - someone under the age of consent detains and rapes someone over the age of consent; close-in-age - in Canada the age of consent is 16, but there are two close-in-age exemptions such as teenagers who are 14 or 15 may have sex with a partner who is less than five years older, and children aged 12 and 13 may have sex with a partner who is less than two years older, and reasonably believe that the victim is over the age of consent - the accused can show that he or she reasonably believed the victim was over the age of consent.
The age of consent is not always constant even within the same jurisdiction as there are also discrepancies. Some examples are position of authority/trust - a person is in a position of trust over a child; the age of consent is set higher, gender age discrepancies - there are different ages of consent for heterosexual sexual activity based on the gender of each person; and homosexual and heterosexual age discrepancies - some jurisdictions have a higher age of consent for homosexual intercourse.