| 1 |
package dialog |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/mitch000001/go-hbci/domain" |
| 5 |
"github.com/mitch000001/go-hbci/message" |
| 6 |
"github.com/mitch000001/go-hbci/segment" |
| 7 |
) |
| 8 |
|
| 9 |
// NewRDHDialog creates a dialog to use with cardreader flow |
| 10 |
func NewRDHDialog(bankID domain.BankID, hbciURL string, clientID string, hbciVersion segment.HBCIVersion) Dialog { |
| 11 |
key, err := domain.GenerateSigningKey() |
| 12 |
if err != nil { |
| 13 |
panic(err) |
| 14 |
} |
| 15 |
signingKey := domain.NewRSAKey(key, domain.NewInitialKeyName(bankID.CountryCode, bankID.ID, clientID, "S")) |
| 16 |
provider := message.NewRDHSignatureProvider(signingKey, 12345) |
| 17 |
d := &rdhDialog{ |
| 18 |
dialog: newDialog(bankID, hbciURL, clientID, hbciVersion, provider, nil), |
| 19 |
} |
| 20 |
return d |
| 21 |
} |
| 22 |
|
| 23 |
type rdhDialog struct { |
| 24 |
*dialog |
| 25 |
} |