Skip to content

lapiy/smart-id-php-client

 
 

Repository files navigation

Build Status License: LGPL v3

Smart-ID PHP client

Introduction

The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-services.

Features

  • 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..

Installation

The recommended way to install Smart-ID PHP Client is through Composer:

composer require sk-id-solutions/smart-id-php-client "~1.0"

Https pinning

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=");

How to use it

Take a look at the examples

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%