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"
Used to prevent man-in-the-middle attacks. More on man in the middle attacks in case of using smart id.
Setting the client to trust specific public keys. SSL certificates used can be found here.
The setPublicSslKeys method requires a string of sha256 hashes of the public keys used delimited with ";". Instructions for extrecting the hashes from certificates can be found here. The supplied string should be of format sha256//sha256-hash-of-the-public-key;
$this->client = new Client();
$this->client
->setRelyingPartyUUID( "YOUR UUID" )
->setRelyingPartyName( "YOUR RP NAME" )
->setHostUrl("HOST_URL")
->setPublicSslKeys("sha256//l2uvq6ftLN4LZ+8Un+71J2vH1BT9wTbtrE5+Fj3Vc5g=;sha256//R8b8SIj92sylUdok0DqfxJJN0yW2O3epE0B+5vpo2eM=");
Take a look at the examples