Is there any method to check the current user password programatically?

I'd like to implement a custom password change form.