Class FinCredentialManager
Helper class for simple querying of PIN, TAN, and other user choices.
public class FinCredentialManager
- Inheritance
-
FinCredentialManager
- Inherited Members
Remarks
In order to provide some very special PIN and TAN management, an application may derive from this class and override the virtual methods as needed.
This class implements a short-lived PIN cache which remembers the PIN entered by GetPin(FinContact) for at most two minutes. If another GetPin(FinContact) call is done within this time, the cached PIN is returned instead of querying the user again.
Constructors
FinCredentialManager(IFinBankingPinStore, IFinCredentialForm, IFinTanProcForm, IFinTanMediaForm)
Creates a new FinCredentialManager with the provided implementations.
public FinCredentialManager(IFinBankingPinStore aPinStore, IFinCredentialForm aCredentialForm, IFinTanProcForm aTanProcForm, IFinTanMediaForm aTanMediaForm)
Parameters
aPinStoreIFinBankingPinStoreOptional IFinBankingPinStore implementation that provides a secure PIN storage. If provided, then a PIN will be retrieved from the PIN storage when needed. An instance of FinBankingPin can be used to directly supply a PIN. If this is
null, then no PIN storage will be used and the PIN is always obtained through GetPin(FinContact)aCredentialFormIFinCredentialFormAn implementation of an IFinCredentialForm. If this is
null, then any attempts to get credentials from the user will just return the result NeedTan, NeedDecoupled, or Cancelled.aTanProcFormIFinTanProcFormReference of an IFinTanProcForm implementation that will be used to prompt the user to select a TAN procedure, when needed. If you are sure that a TAN procedure will never be selected (e.g. when using RDH security), then this may be
null. If this isnull, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanProc.aTanMediaFormIFinTanMediaFormReference of an IFinTanMediaForm implementation that will be used to prompt the user to select a TAN media, when needed. If you are sure that a TAN media will never be selected (e.g. when using RDH security), then this may be
null. If this isnull, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanMedia.
- See Also
FinCredentialManager(IFinBankingPinStore, IFinCredentialForm, IFinTanProcForm, IFinTanMediaForm, IFinDecoupledForm)
Creates a new FinCredentialManager with the provided implementations.
public FinCredentialManager(IFinBankingPinStore aPinStore, IFinCredentialForm aCredentialForm, IFinTanProcForm aTanProcForm, IFinTanMediaForm aTanMediaForm, IFinDecoupledForm aDecoupledForm)
Parameters
aPinStoreIFinBankingPinStoreOptional IFinBankingPinStore implementation that provides a secure PIN storage. If provided, then a PIN will be retrieved from the PIN storage when needed. An instance of FinBankingPin can be used to directly supply a PIN. If this is
null, then no PIN storage will be used and the PIN is always obtained through GetPin(FinContact)aCredentialFormIFinCredentialFormAn implementation of an IFinCredentialForm. If this is
null, then any attempts to get credentials from the user will just return the result NeedTan, NeedDecoupled, or Cancelled.aTanProcFormIFinTanProcFormReference of an IFinTanProcForm implementation that will be used to prompt the user to select a TAN procedure, when needed. If you are sure that a TAN procedure will never be selected (e.g. when using RDH security), then this may be
null. If this isnull, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanProc.aTanMediaFormIFinTanMediaFormReference of an IFinTanMediaForm implementation that will be used to prompt the user to select a TAN media, when needed. If you are sure that a TAN media will never be selected (e.g. when using RDH security), then this may be
null. If this isnull, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanMedia.aDecoupledFormIFinDecoupledFormAn optional implementation of an IFinDecoupledForm. If this is provided, then the form will be used whenever a result NeedDecoupled is encountered. If this is
null, then any NeedDecoupled result will be handed to the plainaCredentialForm, if available.
- See Also
FinCredentialManager(IFinCredentialForm)
LEGACY
public FinCredentialManager(IFinCredentialForm aCredentialForm)
Parameters
aCredentialFormIFinCredentialForm
FinCredentialManager(string)
Creates a FinCredentialManager with a constant PIN value and without any UI.
public FinCredentialManager(string sPin)
Parameters
sPinstringIf this PIN is given, then it will be returned by all GetPin(FinContact) invocations. If this is
null, then ...
Remarks
As this credential manager does not have any UI, any attempts to get credentials will be ignored or cancelled.
Methods
ApproveStoredPin(FinContact)
Is called whenever the PIN previously obtained through GetPin(FinContact) was successfully used.
public virtual void ApproveStoredPin(FinContact aContact)
Parameters
aContactFinContact
AuthenticateContact(FinContact)
public virtual FinAuthenticateResult AuthenticateContact(FinContact aContact)
Parameters
aContactFinContact
Returns
ClearStoredPin(FinContact)
Is called whenever the PIN previously obtained through GetPin(FinContact) was attempted and is definitively wrong.
public virtual void ClearStoredPin(FinContact aContact)
Parameters
aContactFinContact
DisputeStoredPin(FinContact)
Is called whenever the PIN previously obtained through GetPin(FinContact) was attempted and it is unclear, whether it was OK or wrong.
public virtual void DisputeStoredPin(FinContact aContact)
Parameters
aContactFinContact
FindKeyFile(string)
Find the complete path to a key file for a given security media ID.
public virtual string FindKeyFile(string sSecurityMediaID)
Parameters
sSecurityMediaIDstringThe security media ID that was stored in the FinContact is passed here. Usually this already is the complete path to the key file.
Returns
- string
The complete path to the located key file.
Remarks
A specialized implementation may override this method in order to provide some fancy algorithm for locating a key file. The default implementation of this method does nothing but return the parameter sSecurityMediaID as its result.
GetCredential(FinContact, FinCredential)
public virtual bool GetCredential(FinContact aContact, FinCredential aCredential)
Parameters
aContactFinContactaCredentialFinCredential
Returns
- bool
If the requested credentials have been entered and confirmed by clicking [OK], then
trueis returned. If there is no IFinCredentialForm available, or the user cancelled the request, thenfalseis returned.
GetDecoupled(FinContact, FinDialogResult)
Get a DECOUPLED confirmation from the user.
public virtual FinDialogResult GetDecoupled(FinContact aContact, FinDialogResult aResult)
Parameters
aContactFinContactaResultFinDialogResult
Returns
- FinDialogResult
If the user confirms the prompt for a DECOUPLED confirmation, then Success is returned. If the user cancelled the prompt, then Cancelled is returned. If no IFinCredentialForm implementation was provided to this instance, then NeedDecoupled is returned.
GetPin(FinContact)
Get an Online-Banking-PIN or security media PIN or password for a particular contact.
public virtual string GetPin(FinContact aContact)
Parameters
aContactFinContactThe contact for which to get a PIN. This must not be
null.
Returns
GetTan(FinContact, FinDialogResult, out string, out FinResponseHHDUC)
Get a TAN from the user.
public virtual FinDialogResult GetTan(FinContact aContact, FinDialogResult aResult, out string sTan, out FinResponseHHDUC aResponseHHDUC)
Parameters
aContactFinContactaResultFinDialogResultsTanstringReturns the entered TAN or
null.aResponseHHDUCFinResponseHHDUCReturns the response HHDUC data block from the Chip-TAN card reader, or
null.
Returns
- FinDialogResult
If the user successfully entered a TAN, then the parameter
sTanis set and Success is returned. If the user cancelled the prompt, then Cancelled is returned. If no IFinCredentialForm implementation was provided to this instance, then NeedTan is returned.
GetTanMedia(FinContact, FinDialogResult, out FinTanMedia)
Let the user choose one of the TAN medias available.
public virtual FinDialogResult GetTanMedia(FinContact aContact, FinDialogResult aResult, out FinTanMedia aTanMedia)
Parameters
aContactFinContactProvides the FinContact instance for which to select the TAN media.
aResultFinDialogResultThe list of TAN medias to select from.
aTanMediaFinTanMediaReturns the selected TAN media or
null.
Returns
- FinDialogResult
If the user successfully selected a TAN media, then the parameter
aTanMediamust be set and Success is returned. If the user cancelled the prompt, then Cancelled is returned. If no IFinTanMediaForm implementation was provided to this instance, then SelectTanMedia is returned.
Remarks
This is only called when there is more than one active TAN media available to the user. If there is only a single TAN media available, then it is selected implicitly without ever calling this method.
If a IFinTanMediaForm implementation was provided, then it will be called to select the TAN media. If none was provided, then SelectTanMedia is returned.
GetTanProc(FinContact, FinDialogResult, out FinTanProcInfo)
Let the user choose one of the TAN procedures available.
public virtual FinDialogResult GetTanProc(FinContact aContact, FinDialogResult aResult, out FinTanProcInfo aSelectedTanProc)
Parameters
aContactFinContactProvides the FinContact instance for which to select the TAN procedure.
aResultFinDialogResultProvides the list of TAN procedures from which to select.
aSelectedTanProcFinTanProcInfoReturns the selected TAN procedure, or
null.
Returns
- FinDialogResult
If the user successfully selected a TAN procedure, then the parameter
aSelectedTanProcmust be set and Success is returned. If the user cancelled the prompt, then Cancelled is returned. If no IFinTanProcForm implementation was provided to this instance, then SelectTanProc is returned.
Remarks
This is only called when there is more than one TAN procedure available to the user. If there is only a single TAN procedure available, then it is selected implicitly without ever calling this method.
If a IFinTanProcForm implementation was provided, then it will be called to select the TAN procedure. If none was provided, then SelectTanProc is returned.
ResolveResult(FinBanking, FinDialogResult)
Attempts to resolve a result with the help from the user.
public FinDialogResult ResolveResult(FinBanking aBanking, FinDialogResult aResult)
Parameters
aBankingFinBankingaResultFinDialogResult
Returns
- FinDialogResult
If the issue presented by the
aResultwas resolved, then the returned FinDialogResult has the Retry flag set. Otherwise Retry should befalse.
StorePin(FinContact, string)
Store a PIN for a given contact using the global application credentials.
public static void StorePin(FinContact aContact, string sPin)
Parameters
aContactFinContactIdentifies the contact for which the PIN shall be stored.
sPinstringThe PIN that shall be stored. If this is
null, then the stored PIN is erased.
Remarks
Before this method is called, the method SetAppCredentials(string, string) must have been called.
- See Also