Jonathan J. Hansen (“Hansen”), on behalf of himself and his son, Ethan, appeals *599 the district court’s dismissal of his com-, plaint for failure to state a 'claim upon which relief can be granted. Fed. R. Civ. P. 12(b)(6). Hansen’s complaint 1 requested: (1) a religious exemption from social security self-employment tax under 26 U.S.C. (“I.R.C.”) § 1402(g) [hereinafter “§ 1402(g)”]; (2) a declaration that, as applied to Hansen, various portions of § 1402(g) violate the First Amendment’s Free Exercise and Establishment Clauses; (3) a declaration that he and his son are not required to have or use a social security number (“SSN”); and (4) a declaration that “various treasury regulations” are unconstitutional because they discriminate against Hansen based on his religious beliefs.
Concluding that the district court lacked jurisdiction over Hansen’s statutory and constitutional § 1402(g) claims, we vacate its Rule 12(b)(6) dismissal of these claims and remand with directions to enter an order dismissing the claims for lack of subject matter jurisdiction. ' We have jurisdiction under 28 U.S.C. § 1291 and affirm the dismissal of Hansen’s remaining claims.
BACKGROUND
Holding strongly held religious beliefs against having or using an SSN or being involved in the social security system, Hansen sought an exemption from self-employment social security taxes pursuant to § 1402(g). Hansen was denied the exemption because the Social Security Administration and Internal Revenue Service determined he did not meet § 1402(g)’s eligibility requirements. A United States citizen, Hansen was also denied an Individual Taxpayer Identification Number (“ITIN”) because ITINs are available only to individuals who are not citizens, nationals, or permanent residents of the United States. See 26 C.F.R. § 301.6109-l(d)(4). 2
Hansen thereafter filed the complaint at issue, alleging, inter alia, that he has strong religious beliefs against having an SSN, that there is no law requiring him or his son “to get or have a social security number,” and that requiring his son to have an SSN in order to claim a tax deduction violates the First Amendment. Hansen’s complaint further alleged that, “since [he] belongs to an organization that has its own provisions for taking care of its dependent members and has strong beliefs against having or using a social security number,” he was entitled to an exemption under § 1402(g) and that “many of the provisions of [§ 1402(g) ] are unconstitutional as they allow an agency to pick and choose various religions that ‘meet’ the standards and thus, set up an[] unfair system of favoring one group over another, in violation of the First Amendment.”
The United States then moved to dismiss, and Hansen responded with an opposition and a countermotion for summary judgment. The district court granted the Government’s motion to dismiss and denied Hansen’s countermotion, as well as Hansen’s subsequent motion for reconsideration. This appeal followed.
STANDARD OF REVIEW
Our review of a Rule 12(b)(6) dismissal is
de novo
and is limited to the allegations raised in the complaint, which must be taken as true and construed in the light most favorable to the nonmoving par
*600
ty.
See Knievel v. ESPN,
We also review the district court’s denial of a motion for summary judgment
de novo. Moreno v. Baca,
ANALYSIS -
I. Hansen’s § 1402(g) Claims
A) Jurisdiction
Although the Government did not contest, and the district court did not address, federal jurisdiction- over Hansen’s § 1402(g) claims, “[t]he defense of lack of subject matter jurisdiction cannot be waived,”
Augustine v. United States,
B) Anti-Injunction Act 3
The Anti-Injunction Act generally bars any suit “for the purpose of restraining the assessment or collection of any tax.” I.R.C. § 7421(a). The primary purpose of the Act is to protect “the Government’s need to assess and collect taxes as expeditiously as possible with a minimum of pre-enforcement judicial interference, and to require that the legal right to the disputed sums be determined in a suit for refund.”
Bob Jones Univ. v. Simon,
Although Hansen’s complaint does not specifically seek an injunction restraining the assessment or collection of tax, the relief he seeks—a declaration that he qualifies for a § 1402(g) exemption or that the portions of § 1402(g) that render him ineligible for an exemption are unconstitutional—-would “necessarily preclude the collection of’ the challenged tax and therefore falls within the Act’s scope.
4
Bob Jones Univ.,
Accordingly, the Anti-Injunction Act precludes federal jurisdiction over Hansen’s claims unless he is able to satisfy the judicially created exception to the Act by demonstrating (1) irreparable injury if his case is not heard, and (2) certainty of success on the merits.
5
Bob Jones Univ.,
Hansén cannot satisfy either prong of this limited exception. First, dismissing his claim will not result in irreparable injury because, contrary to his contentions,
This is not a case in which an aggrieved party has’ no access at all to judicial review.... [If Hansen] will have taxable income'..., [he] may in accordance with prescribed procedures petition the Tax Court to review the assessment of income taxes. Alternatively, [he] may pay income taxes, or, in their absence, an installment of FICA or FUTA taxes, exhaust the Service’s internal refund procedures, and then bring suit for a refund. These review procedures offer petitioner a full, albeit delayed, opportunity to litigate [his claims].
Bob Jones Univ.,
Second, Hansen’s success on the merits is anything but certain. Hansen admits he does not satisfy the plain language of § 1402(g) because he does not oppose private insurance,
see
§ 1402(g)(1), instead arguing that this element of § 1402(g) is unconstitutional and that the First Amendment requires he be granted an exemption.
6
However, similar First Amendment challenges to social security tax generally and to other clauses in § 1402(g) have been consistently rejected by the courts.
See, e.g., Lee,
Accordingly, the Anti-Injunction Act applies,
7
the district court lacked jurisdiction to hear Hansen’s § 1402(g) claims, and dismissal of these claims is required.
8
Elias v. Connett,
II. Hansen’s Remaining Claims
Hansen’s complaint also seeks an order declaring that: (1) he and his son are not required to have or use an SSN, and (2) “various treasury regulations” unconstitutionally discriminate against Hansen based on his religious beliefs. 9 The district court dismissed these claims, concluding that although no statute specifically requires an individual to obtain an SSN, various statutes and regulations make clear that an SSN is required and that the government has a compelling interest in maintaining a sound social security and tax system, and that the SSN requirement— with its limited exceptions — is narrowly tailored to this interest.
*603 We affirm the dismissal of these claims because Hansen’s complaint fails to specify the particular statutes and regulations requiring use of an SSN that he objects to, but instead seeks a general declaration that he and his son are entitled to never use an SSN and that “various treasury regulations” are unconstitutional. Without knowing the particular regulations and statutes to which Hansen objects, it is impossible to gauge the relevant governmental interest and assess Hansen’s First Amendment and Equal Protection Clause challenges. 10 Accordingly, with respect to these claims, Hansen’s complaint fails to state a claim upon which relief can be granted, and the district court’s dismissal — albeit on other grounds — was not in error.
CONCLUSION
For the reasons set forth above, the district court’s order is
VACATED in part and REMANDED with directions; AFFIRMED in part. Costs on appeal to Appellees.
Notes
. Although Hansen, an attorney, filed his complaint pro se, he was thereafter represented by counsel.
. Section 301.6109-l(d)(4) became effective in 1996. Prior to this time, ITINs were available to those who claimed religious objections to the use of SSNs.
See Miller v. Comm’r,
. The government also challenges Hansen’s standing to raise his § 1402(g) claims, contending his complaint fails to allege an "injury-in-fact” insofar as it does not allege he is self-employed or otherwise subject to the challenged tax. Nor does the complaint allege that Hansen paid the tax or that the tax has ever been (or is likely to be) assessed against him. Because we conclude the Anti-Injunction Act precludes jurisdiction in federal court, we need not resolve this difficult question.
Elias v. Connett,
. Hansen's complaint does not request that the entirety of § 1402(g) be declared unconstitutional. Rather, Hansen seeks either to be declared eligible for a § 1402(g) exemption or a declaration that the portions of the statute rendering him ineligible are unconstitutional, thereby entitling him to an exemption. To the extent Hansen’s complaint can be read as seeking to have the entire exemption held unconstitutional, he may lack standing because such a result would not exempt Hansen from participation in the social security system and therefore would not redress Hansen's alleged injury (compelled participation in social security).
See, e.g., Patterson v. Comm’r,
. The various statutory exceptions to the Anti-Injunction Act are not applicable here. See I.R.C. §§ 6015(e), 6212(a), (c), 6213(a), 6225(b), 6246(b), 6330(e)(1), 6331(1), 6672(b), 6694(c), 7426(a), (b)(1), 7429(b), 7436.
. The constitutional nature of Hansen's § 1402(g) claims is "of no consequence under the Anti-Injunction Act.”
Alexander,
. Because we conclude that the Anti-Injunction Act removed jurisdiction from the district court over Hansen’s § 1402(g) claims, we need not decide whether the Declaratory Judgment Act, 28 U.S.C. § 2201, would also bar Hansen’s action for declaratory relief regarding § 1402(g).
See, e.g., Bob Jones Univ.,
. Because we conclude the district court lacks jurisdiction over Hansen's § 1402(g) claims, Hansen’s appeal from the denial of his coun-termotion for summary judgment seeking a § 1402(g) exemption is moot.
. Hansen has standing to bring these claims because his complaint sufficiently alleges an injury-in-fact (compelled use of an SSN), fairly traceable to the government’s actions (denying his request for an ITIN), that is likely to be redressed by a favorable disposition.
See Friends of the Earth, Inc. v. Laidlaw Envtl. Servs. (TOC), Inc.,
. To the extent Hansen’s claim is simply an objection to being assigned an SSN, his challenge is foreclosed by
Bowen v. Roy,
