How to use HMAC-SHA1, HMAC-SHA2 in conjunction with AES I understand how to compute HMAC-SHA1, HMAC-SHA2 etcetera.

Please explain why/how is the resulting HMAC value is used in conjunction with AES for encryption/decryption and signing/verifying.

In particular:


How does HMAC interact with AES for key sizes (AES-128, AES-196 and AES-256)?
Is the calculated MAC encrypted using AES? And if so, why?
How about signing and verifying? How does the AES cipher play a role here?
Is it correct that the AES ciphertext is HMAC-ed for signing and the HMAC is verified?
Is the calculated MAC encrypted using AES? What is the purpose? How
  about signing and verifying? How does AEs Play a role here? Is the
  case here that the encrypted AES is HMACed for signing and the HMAC is
  verified


No, the MAC is not encrypted per se, however, it is calculated in conjunction with a key (independent of the encryption key).

Simply encrypting your data ensures privacy, however, it doesn't ensure integrity (ie, that the ciphertext hasn't been tampered with since it was encrypted). Using a HMAC provides this integrity.

A simple hash function by itself is not sufficient, as an attacker could alter the ciphertext, calculate a new hash, append it to the new ciphertext, and you would be unable to detect any tampering.  A HMAC solves this problem as it uses a key - meaning that an attacker is unable to create a valid HMAC unless they have a valid key (which only you possess).

You should note that if you plan to encrypt-then-HMAC, you not only need to calculate the MAC of the ciphertext, but also the IV ...ie, HMAC((ciphertext+IV), key)

You should also note that independent keys should be used for the encryption (AES, for example) and the authentication (HMAC).  One approach is to use a masterkey, and then derive two separate keys using a KDF.

Of course, using an authenticated encryption mode such as GCM or EAX is less prone to implementation errors (assuming you're using a well-vetted library), and is recommended if you don't have much experience in crypto.