Class EbicsSecurityMediumFile
public class EbicsSecurityMediumFile : IEbicsSecurityMedium, IEbicsSecurityMediumPrivKeys
- Inheritance
-
EbicsSecurityMediumFile
- Implements
- Inherited Members
Fields
CLASSNAME
public const string CLASSNAME = "Subsembly.EBICS.EbicsSecurityMediumFile"
Field Value
Properties
CanChangePIN
Indicates whether the password can be changed.
public bool CanChangePIN { get; }
Property Value
- bool
Changing the password is supported by this implementation and therefor this property is always
true
.
LastError
public EbicsSecurityMediumErrorCode LastError { get; }
Property Value
SecurityMedium
Always is "0100".
public string SecurityMedium { get; }
Property Value
SecurityMediumID
public string SecurityMediumID { get; }
Property Value
SecurityMediumType
public EbicsSecurityMediumType SecurityMediumType { get; }
Property Value
Remarks
All implementations derived from this base class implement key file security. Thus, this method always returns File.
State
public EbicsSecurityMediumState State { get; }
Property Value
SupportedSecurityCodes
Provides the set of EBICS security operations that are supported by this security media implementation.
public EbicsSecurityCode SupportedSecurityCodes { get; }
Property Value
Remarks
The EbicsSecurityMediumFile implementation always supports all security operations defined by the EbicsSecurityCode enumeration. However, only those security operations are possible, where there are actually private keys available in the selected key file.
Methods
Authenticate(string)
public bool Authenticate(string sPIN)
Parameters
sPIN
string
Returns
Exceptions
- InvalidOperationException
There is no file selected.
ChangePIN(string, string)
Change the password used to protect the key file.
public bool ChangePIN(string sOldPIN, string sNewPIN)
Parameters
sOldPIN
stringThe old password to be changed. Must not be
null
.sNewPIN
stringThe new password to be assigned. Must not be
null
.
Returns
- bool
If the password was changed successfully, then
true
is returned. If not, thenfalse
is returned and LastError provides the details.
Remarks
This security medium must be in the Selected, State when this method is called. It will return back into the Null State, regardless of success or failure.
Exceptions
- ArgumentNullException
The parameter sOldPIN or sNewPIN was
null
.- InvalidOperationException
This security medium instance is not in the Selected state.
Create(string, string)
Creates a new key file.
public bool Create(string sSecurityMediaID, string sPIN)
Parameters
sSecurityMediaID
stringThe path to the key file to be created. This must not be
null
and must not be an empty string. This must be a valid file name of a non-existing file.sPIN
stringThe PIN to be assigned to the new file to be created.
Returns
- bool
If the security token was successfully created, then
true
is returned. If creation failed, thenfalse
is returned and LastError provides more information.
Remarks
This method may only be called when this security medium is in the Null State. If the security token was successfully created, then it will be in the Authenticated State. thereafter.
Exceptions
- ArgumentNullException
The parameter sSecurityMediaID or sPIN was
null
.- ArgumentException
The parameter sSecurityMediaID was an empty string.
- InvalidOperationException
There is already a selected file.
GetPasswordInfo()
public EbicsPasswordInfo GetPasswordInfo()
Returns
GetSecurityOperations(EbicsContact)
public IEbicsSecurityOperations GetSecurityOperations(EbicsContact aContact)
Parameters
aContact
EbicsContact
Returns
Release()
public void Release()
Select(string)
Select existing key file.
public bool Select(string sSecurityMediaID)
Parameters
sSecurityMediaID
stringThe path to the existing key file to select. This must not be
null
and must not be an empty string. This must be a valid file name of an existing file.
Returns
Exceptions
- ArgumentNullException
The parameter sSecurityMediaID was
null
.- ArgumentException
The parameter sSecurityMediaID was an empty string.
- InvalidOperationException
There is already a selected file.