Class FinCredentialManager
Helper class for simple querying of PIN, TAN, and other user choices.
Inheritance
Inherited Members
Namespace: Subsembly.FinTS.Online
Assembly: Subsembly.FinTS.Core.dll
Syntax
public class FinCredentialManager
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.
Declaration
public FinCredentialManager(IFinBankingPinStore aPinStore, IFinCredentialForm aCredentialForm, IFinTanProcForm aTanProcForm, IFinTanMediaForm aTanMediaForm)
Parameters
Type | Name | Description |
---|---|---|
IFinBankingPinStore | aPinStore | 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 |
IFinCredentialForm | aCredentialForm | An implementation of an IFinCredentialForm. If this is |
IFinTanProcForm | aTanProcForm | 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 |
IFinTanMediaForm | aTanMediaForm | 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 |
See Also
FinCredentialManager(IFinCredentialForm)
LEGACY
Declaration
public FinCredentialManager(IFinCredentialForm aCredentialForm)
Parameters
Type | Name | Description |
---|---|---|
IFinCredentialForm | aCredentialForm |
FinCredentialManager(String)
Creates a FinCredentialManager with a constant PIN value and without any UI.
Declaration
public FinCredentialManager(string sPin)
Parameters
Type | Name | Description |
---|---|---|
System.String | sPin | If this PIN is given, then it will be returned by all
GetPin(FinContact) invocations. If this is |
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.
Declaration
public virtual void ApproveStoredPin(FinContact aContact)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact |
AuthenticateContact(FinContact)
Declaration
public virtual FinAuthenticateResult AuthenticateContact(FinContact aContact)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact |
Returns
Type | Description |
---|---|
FinAuthenticateResult |
ClearStoredPin(FinContact)
Is called whenever the PIN previously obtained through GetPin(FinContact) was attempted and is definitively wrong.
Declaration
public virtual void ClearStoredPin(FinContact aContact)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact |
DisputeStoredPin(FinContact)
Is called whenever the PIN previously obtained through GetPin(FinContact) was attempted and it is unclear, whether it was OK or wrong.
Declaration
public virtual void DisputeStoredPin(FinContact aContact)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact |
FindKeyFile(String)
Find the complete path to a key file for a given security media ID.
Declaration
public virtual string FindKeyFile(string sSecurityMediaID)
Parameters
Type | Name | Description |
---|---|---|
System.String | sSecurityMediaID | 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
Type | Description |
---|---|
System.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)
Declaration
public virtual bool GetCredential(FinContact aContact, FinCredential aCredential)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | |
FinCredential | aCredential |
Returns
Type | Description |
---|---|
System.Boolean | If the requested credentials have been entered and confirmed by clicking [OK], then
|
GetDecoupled(FinContact, FinDialogResult)
Get a DECOUPLED confirmation from the user.
Declaration
public virtual FinDialogResult GetDecoupled(FinContact aContact, FinDialogResult aResult)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | |
FinDialogResult | aResult |
Returns
Type | Description |
---|---|
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.
Declaration
public virtual string GetPin(FinContact aContact)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | The contact for which to get a PIN. This must not be |
Returns
Type | Description |
---|---|
System.String |
GetTan(FinContact, FinDialogResult, out String, out FinResponseHHDUC)
Get a TAN from the user.
Declaration
public virtual FinDialogResult GetTan(FinContact aContact, FinDialogResult aResult, out string sTan, out FinResponseHHDUC aResponseHHDUC)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | |
FinDialogResult | aResult | |
System.String | sTan | Returns the entered TAN or |
FinResponseHHDUC | aResponseHHDUC | Returns the response HHDUC data block from the Chip-TAN card reader, or
|
Returns
Type | Description |
---|---|
FinDialogResult | If the user successfully entered a TAN, then the parameter |
GetTan(FinContact, FinTanProcessParameters, FinChallengeInfo)
LEGACY: Do not use. GetTan(FinContact, FinDialogResult, out String, out FinResponseHHDUC)
Declaration
public virtual string GetTan(FinContact aContact, FinTanProcessParameters aTanProc, FinChallengeInfo aChallengeInfo)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | |
FinTanProcessParameters | aTanProc | |
FinChallengeInfo | aChallengeInfo |
Returns
Type | Description |
---|---|
System.String |
GetTanMedia(FinContact, FinDialogResult, out FinTanMedia)
Let the user choose one of the TAN medias available.
Declaration
public virtual FinDialogResult GetTanMedia(FinContact aContact, FinDialogResult aResult, out FinTanMedia aTanMedia)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | Provides the FinContact instance for which to select the TAN media. |
FinDialogResult | aResult | The list of TAN medias to select from. |
FinTanMedia | aTanMedia | Returns the selected TAN media or |
Returns
Type | Description |
---|---|
FinDialogResult | If the user successfully selected a TAN media, then the parameter
|
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.
Declaration
public virtual FinDialogResult GetTanProc(FinContact aContact, FinDialogResult aResult, out FinTanProcInfo aSelectedTanProc)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | Provides the FinContact instance for which to select the TAN procedure. |
FinDialogResult | aResult | Provides the list of TAN procedures from which to select. |
FinTanProcInfo | aSelectedTanProc | Returns the selected TAN procedure, or |
Returns
Type | Description |
---|---|
FinDialogResult | If the user successfully selected a TAN procedure, then the parameter
|
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.
Declaration
public FinDialogResult ResolveResult(FinBanking aBanking, FinDialogResult aResult)
Parameters
Type | Name | Description |
---|---|---|
FinBanking | aBanking | |
FinDialogResult | aResult |
Returns
Type | Description |
---|---|
FinDialogResult | If the issue presented by the |
StorePin(FinContact, String)
Store a PIN for a given contact using the global application credentials.
Declaration
public static void StorePin(FinContact aContact, string sPin)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | Identifies the contact for which the PIN shall be stored. |
System.String | sPin | The PIN that shall be stored. If this is |
Remarks
Before this method is called, the method SetAppCredentials(String, String) must have been called.