The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-services.
- Simple interface for user authentication
Smart-ID PHP client works with PHP 7.2 or later.
This PHP client cannot be used to create digitally signed containers because PHP does not have a library like DigiDoc4J..
The recommended way to install Smart-ID PHP Client is through Composer:
composer require sk-id-solutions/smart-id-php-client "~1.0"
The client automatically trusts sk demo and live env public keys
Examples of configuring
When not specified the client will trust SK live and demo env keys
$this->client = new Client();
$this->client
->setRelyingPartyUUID( "YOUR UUID" )
->setRelyingPartyName( "YOUR RP NAME" )
->setHostUrl("HOST_URL");
Trusting only live env public keys
$this->client = new Client();
$this->client
->setRelyingPartyUUID( "YOUR UUID" )
->setRelyingPartyName( "YOUR RP NAME" )
->setHostUrl("HOST_URL")
->useOnlyLivePublicKey();
Trusting only demo env public keys
$this->client = new Client();
$this->client
->setRelyingPartyUUID( "YOUR UUID" )
->setRelyingPartyName( "YOUR RP NAME" )
->setHostUrl("HOST_URL")
->useOnlyDemoPublicKey();
Trusting custom public keys
$this->client = new Client();
$this->client
->setRelyingPartyUUID( "YOUR UUID" )
->setRelyingPartyName( "YOUR RP NAME" )
->setHostUrl("HOST_URL")
->setPublicSslKeys("sha256//+Tz0G7u3vgcaw/o32vIoCNNjpfo8UugQEXmWkrCuc4o=;sha256//wkdgNtKpKzMtH/zoLkgeScp1Ux4TLm3sUldobVGA/g4=");
Take a look at the examples