Class EbicsContact
Collects all information required for EBICS communication of a particular user with a particular bank.
public sealed class EbicsContact : EbicsElement, IEbicsJsonConverter
- Inheritance
-
EbicsContact
- Implements
- Inherited Members
- Extension Methods
Remarks
Whenever a property is changed the complete contact data is re-saved in it's ContactFolder. Thus, in order to optimize updating multiple properties the method BeginUpdate() should be called before, and the method EndUpdate() should be called after changing the properties. This ensures that the contact data is only saved once at the end of the update.
Constructors
EbicsContact()
public EbicsContact()
EbicsContact(EbicsContact)
Creates a new EbicsContact using another EbicsContact as an initialisation template.
public EbicsContact(EbicsContact aContact)
Parameters
aContact
EbicsContact
Remarks
As it is a new EbicsContact it is initialised with a new ContactGuid. The new contact is not added to an IEbicsContactFolder. None of user or bank keys are copied to the newly created contact.
Exceptions
- ArgumentNullException
The parameter
aContact
wasnull
.
EbicsContact(EbicsVersion)
Creates an all new EBICS contact from scratch.
public EbicsContact(EbicsVersion nVersion)
Parameters
nVersion
EbicsVersionThe EBICS version for which to create a new contact. Use the value Default to create a contact for the recommended default EBICS version.
Fields
DEFAULTHOSTTIMEOUT
The default host response timeout in milliseconds.
public const int DEFAULTHOSTTIMEOUT = 60000
Field Value
MAXHOSTIDLENGTH
Maximum length of HostID (=35).
public const int MAXHOSTIDLENGTH = 35
Field Value
Remarks
In earlier EBICS versions the maximum length of the HostID was defined as 8 characters. In the current version it is 35 characters, which is the value that is defined here.
MAXPARTNERIDLENGTH
Maximum length of PartnerID (=35).
public const int MAXPARTNERIDLENGTH = 35
Field Value
Remarks
In earlier EBICS versions the maximum length of the PartnerID was defined as 8 characters. In the current version it is 35 characters, which is the value that is defined here.
MAXSYSTEMIDLENGTH
Maximum length of SystemID (=35).
public const int MAXSYSTEMIDLENGTH = 35
Field Value
Remarks
In earlier EBICS versions the maximum length of the SystemID was defined as 8 characters. In the current version it is 35 characters, which is the value that is defined here.
MAXUSERIDLENGTH
Maximum length of UserID (=35).
public const int MAXUSERIDLENGTH = 35
Field Value
Remarks
In earlier EBICS versions the maximum length of the UserID was defined as 8 characters. In the current version it is 35 characters, which is the value that is defined here.
Properties
AuthenticationVersion
public EbicsSecurityCode AuthenticationVersion { get; set; }
Property Value
BankAuthenticationPubKey
public EbicsPubKeyInfo BankAuthenticationPubKey { get; set; }
Property Value
BankEncryptionPubKey
public EbicsPubKeyInfo BankEncryptionPubKey { get; set; }
Property Value
CanCreateIniLetter
Indicates whether all information and public keys that are needed by CreateIniLetter(string, string) is available in this contant.
public bool CanCreateIniLetter { get; }
Property Value
ContactFolder
The ContactFolder from which this EbicsContact instance was loaded.
public IEbicsContactFolder ContactFolder { get; set; }
Property Value
ContactGuid
A GUID that uniquely identifies this contact.
public Guid ContactGuid { get; }
Property Value
Remarks
This property is managed automatically by the EbicsContact class and therefore can only be read. A newly created EbicsContact will always get a new GUID. If an EbicsContact instance is stored, its GUID is stored with it, and also restored when loaded.
This GUID is used as the primary key when storing an EbicsContact in an IEbicsContactFolder.
ContactName
Optional human readable contact name.
public string ContactName { get; set; }
Property Value
- string
The contact name may be
null
or a nonempty string of up to 256 characters. The default value of this property isnull
.
Exceptions
- ArgumentException
An attempt was made to set an empty contact name string.
CountryCode
Two letter ISO country code. If this is not set, then "DE" will be assumed.
public string CountryCode { get; set; }
Property Value
Remarks
The country code is needed to adopt to national variations in the EBICS implementation. In particular it is needed to enable keys with certificates in France.
DefaultAuthorisationLevel
The default authorisation level for signatures created by this user.
public EbicsAuthorisationLevel DefaultAuthorisationLevel { get; set; }
Property Value
Remarks
This authorisation level is only applied, if the AuthorisationLevel was not explicitly set. If this is Null, then a default signature will be assumed by Send(EbicsOrder, IEbicsSecurityMedium, IEbicsTransport).
EncryptionVersion
public EbicsSecurityCode EncryptionVersion { get; set; }
Property Value
HaveBankKeys
public bool HaveBankKeys { get; }
Property Value
HaveUserKeys
public bool HaveUserKeys { get; }
Property Value
HostID
public string HostID { get; set; }
Property Value
HostTimeout
Response timeout for each message in milliseconds.
public int HostTimeout { get; set; }
Property Value
- int
Time in milliseconds. Must not be negative. The value zero means that the timeout is not set, and thus the DEFAULTHOSTTIMEOUT shall be used.
Remarks
After sending a request message to the EBICS host, the transaction engine will at most wait HostTimeout milliseconds for a response message from the EBICS host. If the EBICS host does not respond within this timeout, then the transaction is aborted.
HostURL
The complete URL to the EBICS host including the https: prefix.
public string HostURL { get; set; }
Property Value
IniLetterNeeded
Stored flag that indicates whether an Ini-Letter must probably be sent for this contact.
public bool IniLetterNeeded { get; set; }
Property Value
Remarks
This is just a stored flag and no real indication of the user state. The flag is set, whenever all new keys are created for the user. It is reset, whenever an Ini-Letter is generated.
Parameters
Collection of additional custom parameters
public EbicsParameters Parameters { get; }
Property Value
Remarks
This EbicsParameters collection can be used to store additional custom parameters with this contact.
PartnerID
public string PartnerID { get; set; }
Property Value
SecurityMedium
The value for the EBICS SecurityMedium XML element.
public string SecurityMedium { get; set; }
Property Value
SecurityMediumAssemblyName
Optional name of assembly that contains a custom implementation of the IEbicsSecurityMedium interface for this contact.
public string SecurityMediumAssemblyName { get; set; }
Property Value
SecurityMediumClassName
Name of class that implements the IEbicsSecurityMedium interface for this contact.
public string SecurityMediumClassName { get; set; }
Property Value
- string
If this is
null
, then a default implementation based on the SecurityMediumType will be used. The default value isnull
SecurityMediumID
public string SecurityMediumID { get; set; }
Property Value
SecurityMediumType
Selects the implementation of the user's security medium.
public EbicsSecurityMediumType SecurityMediumType { get; set; }
Property Value
ServiceMap
The EbicsServiceMap that shall be used with this contact.
public EbicsServiceMap ServiceMap { get; set; }
Property Value
Remarks
This value is temporary and is not persisted. It must be set again whenever a EbicsContact is loaded.
If the ServiceMap is not set, then a well known service map for the
CountryCode will be returned, if available. If there is no well known
service map, then the universal Default service map
will be returned. Hence, the return value is never null
.
SignatureVersion
public EbicsSecurityCode SignatureVersion { get; set; }
Property Value
SpoolerActions
Chooses whether this contact opts-in to automated EBICS Spooler processing.
public EbicsFileSpoolerActions SpoolerActions { get; set; }
Property Value
- EbicsFileSpoolerActions
By default all contacts are excluded from automated EBICS Spooler processing. This boolean must be set in order to opt-in.
SpoolerOrderTypeC52
The classic EBICS order type that the EBICS spooler uses for CAMT 052 downloads.
public string SpoolerOrderTypeC52 { get; set; }
Property Value
- string
If this is
null
, then the default "C52" is used. This may be set to "VMK" to download SWIFT MT-942 and have it converted automatically to CAMT 052.
Exceptions
- ArgumentException
An attempt was made to set a non-null value that is not a valid order type.
SpoolerOrderTypeC53
The classic EBICS order type that the EBICS spooler uses for CAMT 053 downloads.
public string SpoolerOrderTypeC53 { get; set; }
Property Value
- string
If this is
null
, then the default "C53" is used. This may be set to "STA" to download SWIFT MT-940 and have it converted automatically to CAMT 053.
Exceptions
- ArgumentException
An attempt was made to set a non-null value that is not a valid order type.
SpoolerOrderTypeC54
The classic EBICS order type that the EBICS spooler uses for CAMT 054 downloads.
public string SpoolerOrderTypeC54 { get; set; }
Property Value
- string
If this is
null
, then the default "C54" is used.
Exceptions
- ArgumentException
An attempt was made to set a non-null value that is not a valid order type.
SpoolerOrderTypeHAC
The classic EBICS order type that the EBICS spooler uses for EBICS protocol downloads.
public string SpoolerOrderTypeHAC { get; set; }
Property Value
- string
If this is
null
, then the default "HAC" is used. This may be set to "PTK" to download old style text protocols.
Exceptions
- ArgumentException
An attempt was made to set a non-null value that is not a valid order type.
SpoolerSecret
This field is reserved for the EBICS spooler to store secret data needed for execution.
public string SpoolerSecret { get; set; }
Property Value
- string
This value is only meaningful to the EbicsFileSpooler. To store a password the EbicsFileSpooler method StorePassword(EbicsContact, string) must be used. A masked password pattern for the stored password can be obtained via GetPasswordPlaceholder(EbicsContact). Setting this property to
null
effectively clears any stored password.
SystemID
public string SystemID { get; set; }
Property Value
UserAuthenticationPubKey
public EbicsPubKeyInfo UserAuthenticationPubKey { get; }
Property Value
UserEncryptionPubKey
public EbicsPubKeyInfo UserEncryptionPubKey { get; }
Property Value
UserID
public string UserID { get; set; }
Property Value
UserSignaturePubKey
public EbicsPubKeyInfo UserSignaturePubKey { get; }
Property Value
UsesCertificates
Indicates whether this EBICS user uses keys with X.509 certificates.
public bool UsesCertificates { get; }
Property Value
Remarks
Starting with EBICS 3.0 the usage of X.509 certificates is mandatory. When connecting to a French system, X.509 certificates are also mandatory for older EBICS versions.
Version
public EbicsVersion Version { get; set; }
Property Value
Methods
AdoptSecurityKeyFile(string, string, bool, bool, out string)
Adopt the given key file as the security medium for this EbicsContact.
public bool AdoptSecurityKeyFile(string sKeyFilePath, string sKeyFilePassword, bool fAdoptContact, bool fInternalizeKeyFile, out string sErrorMessage)
Parameters
sKeyFilePath
stringComplete path and filename to the key file to be adopted. The EbicsContact will store a reference to this path, so the key file must remain at this location, even after it was adopted, unless the parameter fInternalizeKeyFile was
true
.sKeyFilePassword
stringfAdoptContact
boolIf
true
, then an attempt is made to read EBICS contact data (HostID, UserID, etc.) from the key file. The contact data from the key file will overwrite the existing contact data in this contact.fInternalizeKeyFile
boolIf
true
, then all key data, including the private keys, will be imported into this contact. The external key file is no longer needed after the key file was imported. The internalized key file will still require the entry of the same key file password.sErrorMessage
string
Returns
AdoptSecurityMedium(IEbicsSecurityMedium)
Adopt the given security medium for this EbicsContact.
public void AdoptSecurityMedium(IEbicsSecurityMedium aSecurityMedium)
Parameters
aSecurityMedium
IEbicsSecurityMediumThe security medium that shall be adopted. This can be in any state. It is NOT released by this method. It is up to the caller to release the security when he is done with it.
Remarks
This method will set all security and security medium related properties of this instance to effectively adopt the given security medium. It may also change the Version if needed to match the security medium.
Exceptions
- ArgumentNullException
The parameter
aSecurityMedium
wasnull
.
Authenticate(string)
Obtains a new authenticated security medium instance for this contact.
public IEbicsSecurityMedium Authenticate(string sPassword)
Parameters
sPassword
stringThe password (or PIN) that shall be used to authenticate the security medium configured for this contact.
Returns
- IEbicsSecurityMedium
Always returns an authenticated IEbicsSecurityMedium instance. This never returns
null
, as errors are thrown as exceptions.
Exceptions
- InvalidOperationException
No security medium is configured for this contact.
- EbicsException
If the security medium could not be authenticated, then an EbicsException will be thrown.
BeginUpdate()
Begin a series of property changes.
public void BeginUpdate()
Remarks
Changing multiple properties should be optimized by calling this method before changing the properties and EndUpdate() after changing the properties.
BlockKeys(IEbicsSecurityMedium, IEbicsTransport)
Creates an EbicsOrderSPR instance and uses it to block the users keys at the bank (SPR).
public EbicsOrderSPR BlockKeys(IEbicsSecurityMedium aSecMedium, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user. Must not be
null
.aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsOrderSPR
Returns the created EbicsOrderSPR instance. This can be used to check whether the request was successful.
BuildXml(XmlDocument, EbicsVersion)
public override XmlElement BuildXml(XmlDocument xmlDocument, EbicsVersion nEbicsVersion)
Parameters
xmlDocument
XmlDocumentnEbicsVersion
EbicsVersionThe given EBICS version is currently ignored but should be Contact in order to ensure compatibility with future versions.
Returns
Remarks
This method always builds an XML element according to its own rules using an unnamed default namespace.
ChangeKeys(IEbicsSecurityMedium, EbicsSecurityCode, EbicsSecurityCode, EbicsSecurityCode, IEbicsTransport)
Creates a complete set of new user keys (signature, authentication and encryption) and initiates a user key update via HCS upload order.
public EbicsOrderHCS ChangeKeys(IEbicsSecurityMedium aSecMedium, EbicsSecurityCode nSignatureVersion, EbicsSecurityCode nAuthenticationVersion, EbicsSecurityCode nEncryptionVersion, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user for the new keys. Must not be
null
. This security medium must implement IEbicsSecurityMediumPrivKeys, hence smart cards are not supported.nSignatureVersion
EbicsSecurityCodeNew User Signature Key Version. This must be either A004, A005, or A006. If this contact already uses H005, or later, then A004 is not allowed.
nAuthenticationVersion
EbicsSecurityCodeThe Version of the new Authentication Key. This must be either X001, or X002.
nEncryptionVersion
EbicsSecurityCodeThe Version of the new Encryption Key. This must be either E001, or E002.
aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
Exceptions
- ArgumentNullException
Either
aSecMedium
oraTransport
wasnull
.- ArgumentException
An invalid value for
nSignatureVersion
,nAuthenticationVersion
, ornEncryptionVersion
was given.- InvalidOperationException
The given
aSecMedium
does not support management of private keys.
ChangeSystemKeys(IEbicsSecurityMedium, EbicsSecurityCode, EbicsSecurityCode, IEbicsTransport)
Creates an EbicsOrderHCA instance and uses it to change the system keys (HCA)
public EbicsOrderHCA ChangeSystemKeys(IEbicsSecurityMedium aSecMedium, EbicsSecurityCode nAuthenticationVersion, EbicsSecurityCode nEncryptionVersion, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user. Must not be
null
. This security medium must implement IEbicsSecurityMediumPrivKeys, hence smart cards are not supported.nAuthenticationVersion
EbicsSecurityCodeThe Version of the new Authentication Key. This must be either X001, or X002.
nEncryptionVersion
EbicsSecurityCodeThe Version of the new Encryption Key. This must be either E001, or E002.
aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsOrderHCA
Returns the EbicsOrderHCA that was built and sent. This can be used to determine whether the key change transaction was successful.
Exceptions
- ArgumentNullException
Either
aSecMedium
oraTransport
wasnull
.- ArgumentException
An invalid value for
nAuthenticationVersion
ornEncryptionVersion
was given.- InvalidOperationException
The given
aSecMedium
does not support management of private keys.
ChangeUserKey(IEbicsSecurityMedium, EbicsSecurityCode, IEbicsTransport)
Creates an EbicsOrderPUB instance and uses it to change the users signature key (PUB).
public EbicsOrderPUB ChangeUserKey(IEbicsSecurityMedium aSecMedium, EbicsSecurityCode nSignatureVersion, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user for the new key. Must not be
null
. This security medium must implement IEbicsSecurityMediumPrivKeys, hence smart cards are not supported.nSignatureVersion
EbicsSecurityCodeNew User Signature Key Version. This must be either A004, A005, or A006. If this contact already uses H005, or later, then A004 is not allowed.
aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsOrderPUB
Returns the EbicsOrderPUB that was built and sent. This can be used to determine whether the key change transaction was successful.
Exceptions
- ArgumentNullException
Either
aSecMedium
oraTransport
wasnull
.- ArgumentException
An invalid value for
nSignatureVersion
was given.- InvalidOperationException
The given
aSecMedium
does not support management of private keys.
Clone()
public EbicsContact Clone()
Returns
Remarks
CreateContact(JsonObject)
Creates an new EbicsContact from its json representation.
public static EbicsContact CreateContact(JsonObject jsonContact)
Parameters
jsonContact
JsonObjectjson representation of an EbicsContact. The version property is mandatory.
Returns
Exceptions
- ArgumentNullException
The specified jsonContact was
null
.- ArgumentException
The specified jsonContact doesn't contain a 'version' element.
CreateIniLetter(string)
Creates an Ini-Letter document that can be printed or converted to a PDF.
public ReportDocument CreateIniLetter(string sFooterText)
Parameters
sFooterText
stringOptional text that is added at the bottom of each page. If this is
null
, then a default footer test is added. In order to remove the footer, pass an empty string in this parameter.
Returns
- ReportDocument
Remarks
Invoke the methods CreatePDF
or WritePDF
on the returned document
in order to create a binary PDF representation.
- See Also
CreateIniLetter(string, string)
Creates an Ini-Letter document that can be printed or converted to a PDF.
public ReportDocument CreateIniLetter(string sAddressLines, string sFooterText)
Parameters
sAddressLines
stringOptional address text that is included at the top of the first page. The address lines must be separated by CRLF or just LF characters.
sFooterText
stringOptional text that is added at the bottom of each page. If this is
null
, then a default footer test is added. In order to remove the footer, pass an empty string in this parameter.
Returns
- ReportDocument
Remarks
Invoke the methods CreatePDF
or WritePDF
on the returned document
in order to create a binary PDF representation.
- See Also
CreateSecurityMedium()
Creates a new instance of the IEbicsSecurityMedium implementation required for this contact.
public IEbicsSecurityMedium CreateSecurityMedium()
Returns
DownloadBankKeys(IEbicsSecurityMedium, IEbicsTransport)
Creates an EbicsOrderHPB instance and uses it to download the bank keys (HPB).
public EbicsOrderHPB DownloadBankKeys(IEbicsSecurityMedium aSecMedium, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user. Must not be
null
.aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsOrderHPB
If the transaction was sent, then the completed EbicsOrderHPB instance is returned. If the transaction could not be built, then
null
is returned.Even if successful, the downloaded bank keys are NOT stored in the given EbicsContact. The downloaded bank keys are only returned through the EbicsOrderHPB instance. It is up to the caller to store these bank keys in this contact.
EndUpdate()
Finish a series of property changes.
public void EndUpdate()
ExportKeys(string, string, string, bool)
Export all user keys and user data from this contact into a new, external key file.
public EbicsSecurityMediumErrorCode ExportKeys(string sFilename, string sContactPassword, string sKeyFilePassword, bool fAdoptKeyFile)
Parameters
sFilename
stringThe complete path of the new key file that shall be created.
sContactPassword
stringThe password for this contact.
sKeyFilePassword
stringPassword that will be used for the new key file.
fAdoptKeyFile
boolIf this is
true
, then this EbicsContact will be reconfigured to reference the newly created external key file and dismiss the previous security medium.
Returns
- EbicsSecurityMediumErrorCode
If the export was successful, then the explicit value Success is returned. If the export failed, then a suitable error code will be returned.
Exceptions
- ArgumentNullException
Any of the parameters was
null
.
ExpulseSecurityMedium()
Reset all any any information about the security medium associated with this contact.
public void ExpulseSecurityMedium()
FromJson(JsonObject)
Initializes an EbicsContact from its json representation. FromJson(JsonObject).
public void FromJson(JsonObject jsonObject)
Parameters
jsonObject
JsonObject
ImportKeys(string)
public EbicsSecurityMediumErrorCode ImportKeys(string sPassword)
Parameters
sPassword
string
Returns
LoadContact(string)
Load an EbicsContact from a file where it was previously saved.
public static EbicsContact LoadContact(string sFileName)
Parameters
sFileName
string
Returns
ModifyContact(JsonObject)
public void ModifyContact(JsonObject jsonObjectChanges)
Parameters
jsonObjectChanges
JsonObject
ParseXml(XmlElement, EbicsVersion)
public override void ParseXml(XmlElement xmlElement, EbicsVersion nEbicsVersion)
Parameters
xmlElement
XmlElementnEbicsVersion
EbicsVersionThe given EBICS version is currently ignored but should be Contact in order to ensure compatibility with future versions.
Remarks
This method always expects an XML element that was built by BuildXml(XmlDocument, EbicsVersion) which uses an unnamed default namespace.
Send(EbicsOrder, IEbicsSecurityMedium, IEbicsTransport)
Send an EBICS order, authenticated by this contact.
public EbicsErrorClass Send(EbicsOrder aOrder, IEbicsSecurityMedium aSecurityMedium, IEbicsTransport aTransport = null)
Parameters
aOrder
EbicsOrderaSecurityMedium
IEbicsSecurityMediumAuthenticated security medium which will be used to create the authentication signature on the EBICS request. Must not be
null
. The referenced security medium must be in the Authenticated state.aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsErrorClass
Returns the worse error class from the technical and business return codes (if any). If some error with the security medium occured, then SecurityMediumError is returned. If the transaction failed completely without ever receiving a return code, then an exception is thrown.
Remarks
This method automatically signs any upload orders that require a signature, unless they are already signed.
Exceptions
- ArgumentNullException
One of the arguments was
null
.- ArgumentException
Either the given EbicsOrder was incomplete or the security medium was not in the Authenticated state.
- See Also
Send(EbicsOrder, string)
Send an EBICS order on behalf of this contact.
public EbicsErrorClass Send(EbicsOrder aOrder, string sPassword)
Parameters
aOrder
EbicsOrdersPassword
stringThe password or PIN that shall be used to authenticate the security medium configured for this contact. This must not be
null
.
Returns
Remarks
This method does not work with smart card readers with secure PIN entry.
Exceptions
- InvalidOperationException
This contact is not ready for sending orders.
- EbicsException
The security medium is not available or could not be authenticated.
Send(EbicsOrder, string, IEbicsTransport)
Send an EBICS order on behalf of this contact.
public EbicsErrorClass Send(EbicsOrder aOrder, string sPassword, IEbicsTransport aTransport = null)
Parameters
aOrder
EbicsOrdersPassword
stringThe password or PIN that shall be used to authenticate the security medium configured for this contact. This must not be
null
.aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
Remarks
This method does not work with smart card readers with secure PIN entry.
Exceptions
- InvalidOperationException
This contact is not ready for sending orders.
- EbicsException
The security medium is not available or could not be authenticated.
SendSystemKeys(IEbicsSecurityMedium, IEbicsTransport)
Creates an EbicsOrderHIA instance and uses it to sends the system keys to the bank (HIA).
public EbicsOrderHIA SendSystemKeys(IEbicsSecurityMedium aSecMedium, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user. Must not be
null
.aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsOrderHIA
If the transaction was sent, then the completed EbicsOrderHIA instance is returned. If the transaction could not be built, then
null
is returned.
SendUserKey(IEbicsSecurityMedium, IEbicsTransport)
Creates an EbicsOrderINI instance and uses it to sends the users signature key to the bank (INI).
public EbicsOrderINI SendUserKey(IEbicsSecurityMedium aSecMedium, IEbicsTransport aTransport = null)
Parameters
aSecMedium
IEbicsSecurityMediumAuthenticated security medium of the user. Must not be
null
.aTransport
IEbicsTransportAn IEbicsTransport implementation for sending the HTTP request. If this is
null
, then the EbicsTransportFactory will be used to create an IEbicsTransport implementation.
Returns
- EbicsOrderINI
If the transaction was sent, then the completed EbicsOrderINI instance is returned. If the transaction could not be built, then
null
is returned.
Sign(EbicsOrder, IEbicsSecurityMedium)
Add a signature (EU) to the given order.
public EbicsSecurityMediumErrorCode Sign(EbicsOrder aOrder, IEbicsSecurityMedium aSecurityMedium)
Parameters
aOrder
EbicsOrderThe order to be signed. This must be completely set up and include all order data.
aSecurityMedium
IEbicsSecurityMediumAuthenticated security medium which will be used to create the electronic signature (EU) for the order. Must not be
null
. The referenced security medium must be in the Authenticated state.
Returns
- EbicsSecurityMediumErrorCode
If there was an error with the security media while producing the signature, then an appropriate error code is returned. If the signature was produced successfully, then Success is returned.
Exceptions
- ArgumentNullException
One of the arguments was
null
.- ArgumentException
Either the given EbicsOrder was incomplete or the security medium was not in the Authenticated state.
- InvalidOperationException
This EbicsContact was not completely initialized.
ToJson(JsonObject)
Converts an EbicsContact to its json representation. ToJson(JsonObject).
public JsonObject ToJson(JsonObject jsonObject)
Parameters
jsonObject
JsonObject
Returns
ToString()
public override string ToString()
Returns
- string
Usually returns the ContactName. If the contact name is
null
, then a string representation of the ContactGuid is returned instead.