add a way to parse rfc822 dates.

In preparation for the clock skewed check which will
help prevent replay attacks.
factor out the copy logic.