Class FinCredentialManager

Namespace
Subsembly.FinTS.Online
Assembly
Subsembly.FinTS.Core.dll

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

aPinStore IFinBankingPinStore

Optional 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)

aCredentialForm IFinCredentialForm

An 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.

aTanProcForm IFinTanProcForm

Reference 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 is null, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanProc.

aTanMediaForm IFinTanMediaForm

Reference 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 is null, 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

aPinStore IFinBankingPinStore

Optional 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)

aCredentialForm IFinCredentialForm

An 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.

aTanProcForm IFinTanProcForm

Reference 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 is null, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanProc.

aTanMediaForm IFinTanMediaForm

Reference 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 is null, then any attempts to get a TAN procedure selection from the user will just return the result SelectTanMedia.

aDecoupledForm IFinDecoupledForm

An 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 plain aCredentialForm, if available.

See Also

FinCredentialManager(IFinCredentialForm)

LEGACY

public FinCredentialManager(IFinCredentialForm aCredentialForm)

Parameters

aCredentialForm IFinCredentialForm

FinCredentialManager(string)

Creates a FinCredentialManager with a constant PIN value and without any UI.

public FinCredentialManager(string sPin)

Parameters

sPin string

If 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

aContact FinContact

AuthenticateContact(FinContact)

public virtual FinAuthenticateResult AuthenticateContact(FinContact aContact)

Parameters

aContact FinContact

Returns

FinAuthenticateResult

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

aContact FinContact

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

aContact FinContact

FindKeyFile(string)

Find the complete path to a key file for a given security media ID.

public virtual string FindKeyFile(string sSecurityMediaID)

Parameters

sSecurityMediaID string

The 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

aContact FinContact
aCredential FinCredential

Returns

bool

If the requested credentials have been entered and confirmed by clicking [OK], then true is returned. If there is no IFinCredentialForm available, or the user cancelled the request, then false is returned.

GetDecoupled(FinContact, FinDialogResult)

Get a DECOUPLED confirmation from the user.

public virtual FinDialogResult GetDecoupled(FinContact aContact, FinDialogResult aResult)

Parameters

aContact FinContact
aResult FinDialogResult

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

aContact FinContact

The contact for which to get a PIN. This must not be null.

Returns

string

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

aContact FinContact
aResult FinDialogResult
sTan string

Returns the entered TAN or null.

aResponseHHDUC FinResponseHHDUC

Returns 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 sTan is 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

aContact FinContact

Provides the FinContact instance for which to select the TAN media.

aResult FinDialogResult

The list of TAN medias to select from.

aTanMedia FinTanMedia

Returns the selected TAN media or null.

Returns

FinDialogResult

If the user successfully selected a TAN media, then the parameter aTanMedia must 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

aContact FinContact

Provides the FinContact instance for which to select the TAN procedure.

aResult FinDialogResult

Provides the list of TAN procedures from which to select.

aSelectedTanProc FinTanProcInfo

Returns the selected TAN procedure, or null.

Returns

FinDialogResult

If the user successfully selected a TAN procedure, then the parameter aSelectedTanProc must 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

aBanking FinBanking
aResult FinDialogResult

Returns

FinDialogResult

If the issue presented by the aResult was resolved, then the returned FinDialogResult has the Retry flag set. Otherwise Retry should be false.

StorePin(FinContact, string)

Store a PIN for a given contact using the global application credentials.

public static void StorePin(FinContact aContact, string sPin)

Parameters

aContact FinContact

Identifies the contact for which the PIN shall be stored.

sPin string

The 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