php sign with private key

Solutions on MaxInterview for php sign with private key by the best coders in the world

showing results for - "php sign with private key"
Milan
28 Sep 2020
1<?php
2// $data is assumed to contain the data to be signed
3
4// fetch private key from file and ready it
5$pkeyid = openssl_pkey_get_private("file://sign/key.pem");
6
7// compute signature
8openssl_sign($data$signature$pkeyid);
9
10// free the key from memory
11openssl_free_key($pkeyid);
12