| 1 | package dialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/ |
| 2 | |
| 3 | import ( |
| 4 | "encoding/base64scip-go gomod github.com/golang/go/src go1.18 `encoding/base64`/" |
| 5 | |
| 6 | "github.com/mitch000001/go-hbci/domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/" |
| 7 | "github.com/mitch000001/go-hbci/internalscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/internal`/" |
| 8 | "github.com/mitch000001/go-hbci/messagescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/" |
| 9 | "github.com/mitch000001/go-hbci/segmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/" |
| 10 | "github.com/mitch000001/go-hbci/transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport`/" |
| 11 | httpsscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/https`/ "github.com/mitch000001/go-hbci/transport/httpsscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/https`/" |
| 12 | middlewarescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/middleware`/ "github.com/mitch000001/go-hbci/transport/middlewarescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/middleware`/" |
| 13 | ) |
| 14 | |
| 15 | // Config contains the configuration of a PinTanDialog |
| 16 | type Configscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config# struct { |
| 17 | BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#BankID. domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/BankID# |
| 18 | HBCIURLscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#HBCIURL. string |
| 19 | UserIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#UserID. string |
| 20 | HBCIVersionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#HBCIVersion. segmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/.HBCIVersionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/HBCIVersion# |
| 21 | Transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#Transport. transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport`/.Transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport`/Transport# |
| 22 | } |
| 23 | |
| 24 | // NewPinTanDialog creates a new dialog to use for pin/tan transport |
| 25 | func NewPinTanDialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/NewPinTanDialog().(config Configscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#) *PinTanDialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog# { |
| 26 | pinKey := domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinKeyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinKey().("", domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinTanKeyNamescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinTanKeyName().(config.BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#BankID., config.UserIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#UserID., domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.KeyTypeSigningscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/KeyTypeSigning.)) |
| 27 | signatureProvider := messagescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/.NewPinTanSignatureProviderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/NewPinTanSignatureProvider().(pinKey, initialClientSystemIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/initialClientSystemID.) |
| 28 | pinKey = domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinKeyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinKey().("", domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinTanKeyNamescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinTanKeyName().(config.BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#BankID., config.UserIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#UserID., domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.KeyTypeEncryptionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/KeyTypeEncryption.)) |
| 29 | cryptoProvider := messagescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/.NewPinTanCryptoProviderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/NewPinTanCryptoProvider().(pinKey, initialClientSystemIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/initialClientSystemID.) |
| 30 | d := &PinTanDialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog#{ |
| 31 | dialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog#dialog.: newDialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/newDialog().( |
| 32 | config.BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#BankID., |
| 33 | config.HBCIURLscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#HBCIURL., |
| 34 | config.UserIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#UserID., |
| 35 | config.HBCIVersionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#HBCIVersion., |
| 36 | signatureProvider, |
| 37 | cryptoProvider, |
| 38 | ), |
| 39 | } |
| 40 | |
| 41 | var dialogTransport transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport`/.Transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport`/Transport# |
| 42 | if config.Transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#Transport. == nil { |
| 43 | dialogTransport = httpsscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/https`/.Newscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/https`/New().() |
| 44 | } else { |
| 45 | dialogTransport = config.Transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/Config#Transport. |
| 46 | } |
| 47 | dialogTransport = middlewarescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/middleware`/.Base64Encodingscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/middleware`/Base64Encoding().(base64scip-go gomod github.com/golang/go/src go1.18 `encoding/base64`/.StdEncodingscip-go gomod github.com/golang/go/src go1.18 `encoding/base64`/StdEncoding.)(dialogTransport) |
| 48 | dialogTransport = middlewarescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/middleware`/.Loggingscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/transport/middleware`/Logging().(internalscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/internal`/.Debugscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/internal`/Debug., cryptoProvider)(dialogTransport) |
| 49 | d.transportscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#transport. = dialogTransport |
| 50 | return d |
| 51 | } |
| 52 | |
| 53 | // PinTanDialog represents a dialog to use in pin/tan flow with HTTPS transport |
| 54 | type PinTanDialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog# struct { |
| 55 | *dialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog#dialog. |
| 56 | } |
| 57 | |
| 58 | // SetPin lets the user reset the pin after creation |
| 59 | func (d *PinTanDialogscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog#) SetPinscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/PinTanDialog#SetPin().(pin string) { |
| 60 | pinKey := domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinKeyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinKey().(pin, domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinTanKeyNamescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinTanKeyName().(d.BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#BankID., d.UserIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#UserID., domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.KeyTypeSigningscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/KeyTypeSigning.)) |
| 61 | d.signatureProviderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#signatureProvider. = messagescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/.NewPinTanSignatureProviderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/NewPinTanSignatureProvider().(pinKey, d.ClientSystemIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#ClientSystemID.) |
| 62 | pinKey = domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinKeyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinKey().(pin, domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.NewPinTanKeyNamescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/NewPinTanKeyName().(d.BankIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#BankID., d.UserIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#UserID., domainscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/.KeyTypeEncryptionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/domain`/KeyTypeEncryption.)) |
| 63 | d.cryptoProviderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#cryptoProvider. = messagescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/.NewPinTanCryptoProviderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/message`/NewPinTanCryptoProvider().(pinKey, d.ClientSystemIDscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/dialog`/dialog#ClientSystemID.) |
| 64 | } |