The existing CrossRef export plugin might be a good reference for this. DOIs are a subtype of Public Identifiers, so if you have a Submission object, you can check for such a stored pubId:
The Crossref plugin stores the username and password in its own settings:
To access these settings from another plugin, you’ll need an accessor which can perform similarly to:
but, with the CrossRef plugin’s name rather than your own plugin’s name.
Alternately, since getSetting() isn’t declared private, you could instanciate a CrossRefExportPlugin and call its getSetting() within your plugin.
Out of curiosity, what functionality are you adding to the Crossref integration? Might it be added as part of the Crossref plugin itself?