Class EbicsExtensionMethods

Namespace
Subsembly.EBICS
Assembly
Subsembly.EBICS.Win32.dll

Convenience extension methods for the EbicsContact in Windows environments.

public static class EbicsExtensionMethods
Inheritance
EbicsExtensionMethods
Inherited Members

Methods

AuthenticateSecurityMedium(EbicsContact, IWin32Window)

Interactively creates and authenticates the security medium configured for the given contact.

public static IEbicsSecurityMedium AuthenticateSecurityMedium(this EbicsContact aContact, IWin32Window aOwnerWindow)

Parameters

aContact EbicsContact
aOwnerWindow IWin32Window

Returns

IEbicsSecurityMedium

If the security medium was successfully created and authenticated, then it is returned. It is the responsibility of the caller to finally Release() the security medium, if it is no longer needed. If authentication fails, then null is returned. If so, then an error message box was already displayed to the user, so no additional error prompting is required.

InternalizeKeyFile(EbicsContact, IWin32Window)

Copies the keys from a key file based security medium to a new EbicsSecurityMediumVoid instance that is then associated with this contact.

public static void InternalizeKeyFile(this EbicsContact aContact, IWin32Window aOwnerWindow)

Parameters

aContact EbicsContact
aOwnerWindow IWin32Window

Exceptions

InvalidOperationException

This contact is not using a security medium of type File.

Send(EbicsContact, IWin32Window, EbicsOrder)

Send an EBICS order, authenticated by this contact.

public static EbicsErrorClass Send(this EbicsContact aContact, IWin32Window aOwnerWindow, EbicsOrder aOrder)

Parameters

aContact EbicsContact
aOwnerWindow IWin32Window
aOrder EbicsOrder

Completely initialized order to be sent. This must not be null.

Returns

EbicsErrorClass

Returns the worse error class from the technical and business return codes (if any). If the transaction failed completely without ever receiving a return code, then an exception is thrown.

If the security medium could not be authenticated, e.g. the password entry dialog was cancelled by the user, then the special value SecurityMediumError is returned.

Remarks

This method will create the IEbicsSecurityMedium instance required for this contact and authenticate it. If authentication is successful, then the order will be authenticated and sent.

This method also automatically signs any upload orders that require a signature, unless they are already signed.

Exceptions

ArgumentNullException

The EbicsOrder argument was null.

ArgumentException

The given EbicsOrder was incomplete.

Sign(EbicsContact, IWin32Window, EbicsOrder)

Add a signature (EU) to the given order.

public static bool Sign(this EbicsContact aContact, IWin32Window aOwnerWindow, EbicsOrder aOrder)

Parameters

aContact EbicsContact
aOwnerWindow IWin32Window
aOrder EbicsOrder

The order to be signed. This must be completely set up and must contain some OrderData.

Returns

bool

If successful, then true is returned. If signing failed, e.g. because the security medium could not be authenticated, then false is returned. In case of a failure, an error message box was already displayed to the user, so no additional error prompting is required.

Remarks

This method will create the IEbicsSecurityMedium instance required for this contact and authenticate it. If authentication is successful, then the order data will be signed.

Note that after signing an order it cannot be modified again.

Exceptions

ArgumentNullException

A required parameter was null.

ArgumentException

The given order was not set up completely.