Is there a way to programatically to unlock a 6.2 database?

Hi,
I am using FDB 6.2. But to unlock it, I need to pass the lockID and then type in passphrase. I would like to know Is there a good programatic way that I supply the lockID and be able to call the fdbcli and capture the passphase and reenter it?