|
1 | 1 | # GmSSL-PHP
|
2 | 2 |
|
| 3 | +## Introduction |
3 | 4 | The GmSSL extension is the binding to the GmSSL C library. GmSSL provides functions of Chinese SM2, SM3, SM4, SM9, ZUC crypto algorithms.
|
4 | 5 |
|
| 6 | +## Installation |
5 | 7 |
|
6 |
| -GmSSL Functions |
| 8 | +To compile and install the GmSSL PHP extension, you need to install the GmSSL library (version >= 3.1.0). See the GmSSL INSTALL.md for more details. |
| 9 | + |
| 10 | +```bash |
| 11 | +$ cd GmSSL-PHP-master |
| 12 | +$ phpize |
| 13 | +$ ./configure |
| 14 | +$ make |
| 15 | +$ sudo make install |
| 16 | +``` |
| 17 | + |
| 18 | +You can use `phpinfo()` to see if the GmSSL extension is correctly installed. |
| 19 | + |
| 20 | +```php |
| 21 | +<?php |
| 22 | +phpinfo(); |
| 23 | +?> |
| 24 | +``` |
| 25 | + |
| 26 | +## Predefined Constants |
| 27 | + |
| 28 | +* `GMSSL_PHP_VERSION (string)` |
| 29 | +* `GMSSL_LIBRARAY_VERSION (string)` |
| 30 | +* `GMSSL_SM3_DIGEST_SIZE (int)` |
| 31 | +* `GMSSL_SM3_HMAC_SIZE (int)` |
| 32 | +* `GMSSL_SM4_KEY_SIZE (int)` |
| 33 | +* `GMSSL_SM4_BLOCK_SIZE (int)` |
| 34 | +* `GMSSL_SM4_GCM_MIN_IV_SIZE (int)` |
| 35 | +* `GMSSL_SM4_GCM_MAX_IV_SIZE (int)` |
| 36 | +* `GMSSL_SM4_GCM_DEFAULT_IV_SIZE (int)` |
| 37 | +* `GMSSL_SM4_GCM_MAX_TAG_SIZE (int)` |
| 38 | +* `GMSSL_SM2_DEFAULT_ID (string)` |
| 39 | +* `GMSSL_SM2_MAX_SIGNATURE_SIZE (int)` |
| 40 | +* `GMSSL_SM2_MAX_PLAINTEXT_SIZE (int)` |
| 41 | +* `GMSSL_SM2_MAX_CIPHERTEXT_SIZE (int)` |
| 42 | +* `GMSSL_SM9_SIGNATURE_SIZE (int)` |
| 43 | +* `GMSSL_SM9_MAX_PLAINTEXT_SIZE (int)` |
| 44 | +* `GMSSL_SM9_MAX_CIPHERTEXT_SIZE (int)` |
| 45 | +* `GMSSL_ZUC_KEY_SIZE (int)` |
| 46 | +* `GMSSL_ZUC_IV_SIZE (int)` |
| 47 | + |
| 48 | +## GmSSL Functions |
7 | 49 |
|
8 | 50 | * `gmssl_version_num` - Get version number of the GmSSL C library
|
9 | 51 | * `gmssl_version_str` - Get version string of the GmSSL C library
|
@@ -48,4 +90,3 @@ GmSSL Functions
|
48 | 90 | * `gmssl_sm9_decrypt` - Decrypt SM9 ciphertext with user's SM9 private key
|
49 | 91 |
|
50 | 92 |
|
51 |
| - |
|
0 commit comments