Simplify code for setting PKCS#10 password.

Change-Id: Ib362681aff9f1a0443cfb87a2bd5e12172c652d9