Crypto::NSS::PKCS11 is a Perl module that offers functions needed for communicating with PKCS#11 cryptographic modules.
PKCS#11 is a API for interfacing with cryptographic modules such as software tokens, smart cards. This module provides functions for obtaining certificates, keys, passwords etc.
set_password_func ( CALLBACK )
Sets the function to call when a PKCS#11 module needs a password. The argument CALLBACK must be either a code reference or a fully qualified function name.