Class FinSecurityMediaKeyFile
Abstract base class for all key file based IFinSecurityMedia interface
implementations.
Inheritance
System.Object
FinSecurityMediaKeyFile
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Subsembly.FinTS.Core.dll
public abstract class FinSecurityMediaKeyFile : IFinSecurityMedia
Constructors
Declaration
protected FinSecurityMediaKeyFile()
Properties
Declaration
public FinSecurityMediaCaps Capabilities { get; }
Property Value
Number of contacts that are or may be stored in the key file.
Declaration
public int ContactCapacity { get; }
Property Value
Type |
Description |
System.Int32 |
|
Declaration
public int MaxKeyLength { get; }
Property Value
Type |
Description |
System.Int32 |
|
Declaration
public FinSecurityMediaPassphraseFlags PassphraseFlags { get; }
Property Value
Declaration
public int PassphraseMaxLength { get; }
Property Value
Type |
Description |
System.Int32 |
|
Declaration
public int PassphraseMinLength { get; }
Property Value
Type |
Description |
System.Int32 |
|
Provides the security media ID of the currently selected key file.
Declaration
public string SecurityMediaID { get; }
Property Value
Type |
Description |
System.String |
|
Declaration
public FinSecurityMediaType SecurityMediaType { get; }
Property Value
Declaration
public FinSecurityProfile[] SecurityProfiles { get; }
Property Value
Declaration
public FinSecurityMediaState State { get; }
Property Value
Methods
Declaration
protected void AddContact(FinContact aContact)
Parameters
Add another key to this key store.
Declaration
protected void AddKey(FinSecureKey aKey)
Parameters
Declaration
public FinAuthenticateResult Authenticate(string sUserName, string sPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sUserName |
Optional UserName.
|
System.String |
sPassphrase |
|
Returns
Declaration
public FinAuthenticateResult AuthenticateAdmin(string sUserName, string sAdminPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sUserName |
|
System.String |
sAdminPassphrase |
|
Returns
Declaration
public FinAuthenticateResult AuthenticateSecure()
Returns
Declaration
public bool CanAuthenticateSecure()
Returns
Type |
Description |
System.Boolean |
|
Declaration
Declaration
public bool CanChangePassphraseSecure()
Returns
Type |
Description |
System.Boolean |
|
Declaration
public FinAuthenticateResult ChangePassphrase(string sUserName, string sOldPassphrase, string sNewPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sUserName |
|
System.String |
sOldPassphrase |
|
System.String |
sNewPassphrase |
|
Returns
Declaration
public FinAuthenticateResult ChangePassphraseSecure()
Returns
Declaration
public void Create(string sSecurityMediaID, string sUserName, string sPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sSecurityMediaID |
|
System.String |
sUserName |
|
System.String |
sPassphrase |
|
Declaration
public FinContact CreateContact()
Returns
Declaration
public byte[] Decrypt(FinContact aContact, FinSecureKey aKey, FinOperationMode nOpMode, byte[] vbCrypt)
Parameters
Returns
Type |
Description |
System.Byte[] |
|
Declaration
public void ElevateKey(FinContact aContact, FinSecureKey aKey, FinSecureKeyState nNewKeyState)
Parameters
Declaration
public byte[] Encrypt(FinContact aContact, FinSecureKey aKey, FinOperationMode nOpMode, byte[] vbData)
Parameters
Returns
Type |
Description |
System.Byte[] |
|
Declaration
public void EraseContact(int nContactIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
nContactIndex |
|
Declaration
public void EraseKey(FinContact aContact, FinSecureKey aKey)
Parameters
Generates ans stores a new key.
Declaration
public FinSecureKey GenerateKey(FinContact aContact, FinSecureKeyType nKeyType, int nKeyLength, int nKeyNumber, int nKeyVersion)
Parameters
Type |
Name |
Description |
FinContact |
aContact |
|
FinSecureKeyType |
nKeyType |
|
System.Int32 |
nKeyLength |
|
System.Int32 |
nKeyNumber |
|
System.Int32 |
nKeyVersion |
|
Returns
Always throws a NotSupportedException.
Declaration
public FinAuthenticateResult InitPassphrase(string sUserName, string sPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sUserName |
|
System.String |
sPassphrase |
|
Returns
Declaration
public FinContact ObtainContact(int nContactIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
nContactIndex |
|
Returns
Declaration
public virtual FinSecureKey ObtainKey(FinContact aContact, FinSecureKeyType nKeyType, int nKeyNumber, int nKeyVersion)
Parameters
Returns
Declaration
protected virtual void OnCancel()
Declaration
protected virtual FinAuthenticateResult OnChangePassphrase(string sNewPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sNewPassphrase |
|
Returns
Override in order to create a new key file instance from scratch.
Declaration
protected virtual void OnCreateKeyFile(string sUserName, string sPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sUserName |
Optional UserName parameter.
|
System.String |
sPassphrase |
The passphrase to be used in order to protect the key file.
|
Declaration
protected virtual int OnGetMaxKeyLength()
Returns
Type |
Description |
System.Int32 |
|
Declaration
protected virtual FinSecurityProfile[] OnGetSecurityProfiles()
Returns
Must be overriden in order to fully load a previously selected key file.
Declaration
protected abstract FinAuthenticateResult OnLoadKeyFile(string sUserName, string sPassphrase)
Parameters
Type |
Name |
Description |
System.String |
sUserName |
Optional UserName parameter.
|
System.String |
sPassphrase |
|
Returns
Declaration
protected virtual void OnRelease()
Declaration
protected virtual void OnSaveKeyFile(string sFileName)
Parameters
Type |
Name |
Description |
System.String |
sFileName |
|
Must be overriden in order to select an existing key file.
Declaration
protected abstract FinAuthenticateResult OnSelectKeyFile(string sFileName)
Parameters
Type |
Name |
Description |
System.String |
sFileName |
The complete file name including path and file name extension of the key file to be
selected by this method.
|
Returns
Declaration
Declaration
public void ResetKey(FinContact aContact, FinSecureKey aKey)
Parameters
Declaration
public FinAuthenticateResult Select(string sSecurityMediaID)
Parameters
Type |
Name |
Description |
System.String |
sSecurityMediaID |
|
Returns
Convenience helper that attempts to detect the type of the given key file and
returns a suitable IFinSecurityMedia instance for it.
Declaration
public static IFinSecurityMedia SelectKeyFile(string sFilename)
Parameters
Type |
Name |
Description |
System.String |
sFilename |
The name of the key file to select with a suitable IFinSecurityMedia
implementation. Must not be null .
|
Returns
Type |
Description |
IFinSecurityMedia |
If the key file was successfully detected and also successfully selected by the
IFinSecurityMedia implementation, then a reference to the selected
instance is returned. If the key file was not recognized, or selection failed,
then null is returned.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
The parameter sFilename was null .
|
System.ArgumentException |
The parameter aFilename was an empty string.
|
Declaration
protected void SetCapabilities(FinSecurityMediaCaps nCapabilities)
Parameters
Declaration
protected void SetPassphraseFlags(FinSecurityMediaPassphraseFlags nPassphraseFlags)
Parameters
Declaration
protected void SetPassphraseMaxLength(int nPassphraseMaxLength)
Parameters
Type |
Name |
Description |
System.Int32 |
nPassphraseMaxLength |
|
Declaration
protected void SetPassphraseMinLength(int nPassphraseMinLength)
Parameters
Type |
Name |
Description |
System.Int32 |
nPassphraseMinLength |
|
Declaration
public byte[] SignHash(FinContact aContact, FinSecureKey aKey, FinOperationMode nOpMode, FinHash nHash, byte[] vbHash)
Parameters
Returns
Type |
Description |
System.Byte[] |
|
Declaration
public void StoreContact(int nContactIndex, FinContact aContact)
Parameters
Type |
Name |
Description |
System.Int32 |
nContactIndex |
|
FinContact |
aContact |
|
Declaration
public void StoreKey(FinContact aContact, FinSecureKey aKey)
Parameters
Declaration
public bool Verify(FinContact aContact, FinSecureKey aKey, FinOperationMode nOpMode, FinHash nHash, byte[] vbHash, byte[] vbSignature)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements