class BankIDHttpClientFactory

Factory for creating BankID HTTP clients configured with mTLS certificates.

Methods

__construct(ClientFactory $clientFactory, BankIDConfigInterface $config, KeyRepositoryInterface $keyRepository, FileSystemInterface $fileSystem)

Constructs a new BankIDHttpClientFactory.

ClientInterface
create()

Creates an HTTP client configured with BankID certificates.

array
getHttpOptions(array $env_config, KeyPluginInterface $rp_provider, KeyPluginInterface $srv_cert_provider, string $rp_passphrase)

Prepares the HTTP options array for the BankID client.

bool
isKeyFileProvider(KeyProviderInterface $key_provider)

Check if a key provider is a FileKeyProvider.

Details

at line 32
__construct(ClientFactory $clientFactory, BankIDConfigInterface $config, KeyRepositoryInterface $keyRepository, FileSystemInterface $fileSystem)

Constructs a new BankIDHttpClientFactory.

Parameters

ClientFactory $clientFactory

Factory for creating http clients.

BankIDConfigInterface $config

The BankID configuration.

KeyRepositoryInterface $keyRepository

The key repository.

FileSystemInterface $fileSystem

The file system.

at line 48
ClientInterface create()

Creates an HTTP client configured with BankID certificates.

Return Value

ClientInterface

The configured HTTP client.

Exceptions

InvalidArgumentException

at line 101
protected array getHttpOptions(array $env_config, KeyPluginInterface $rp_provider, KeyPluginInterface $srv_cert_provider, string $rp_passphrase)

Prepares the HTTP options array for the BankID client.

Parameters

array $env_config

The BankID configuration for the active environment.

KeyPluginInterface $rp_provider

The RP certificate key provider.

KeyPluginInterface $srv_cert_provider

The server certificate key provider.

string $rp_passphrase

The RP certificate passphrase.

Return Value

array

The Guzzle HTTP client options.

at line 127
protected bool isKeyFileProvider(KeyProviderInterface $key_provider)

Check if a key provider is a FileKeyProvider.

Parameters

KeyProviderInterface $key_provider

The key provider.

Return Value

bool

TRUE if the key provider is a FileKeyProvider. Else FALSE.