forked from Tysonic/EfrisOnlineMode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post_to_efris.php
78 lines (69 loc) · 1.82 KB
/
post_to_efris.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
use models\Items;
include ("models/items.php");
include("Utils.php");
function post ()
{
$utils = new Utils();
$item = new Items(
"102",
"CFB 300ml",
"0130",
"UN",
"350.99",
"101",
"96010101",
"1",
"10",
"102",
"102",
"",
"",
"",
"",
"",
"102"
);
$passowrdDess = "TY6f/TmApx048AVIeVVDh+riV/7tFbmGl83bblO52BeYCHnqcB5VQ7lwEQqAwyLR2yQR/AhsGMWHH3RX6oHaMTZg+mxKFr4OnZostVI6zl2ERG6rdCiHTwbw33vh9fBnvamkaeAGfMqklmSgcjsX7MsaLacke7W1K6lEaLTpRJd5WA8XUiGjbDxFB7DvhuEgqJUu+AguDASKkxCsA46yvix7hbPnGD10adBws2vYFwPQb8g6Q2gUqzz+H825KFKXQnTlUNdvldtxJzKZ6x1EQciufXqN5ODIeV7ctmH8mCkOQCgWw0OyH50ISB5dUE11aVHH8fRQTR4IXf9mgAQZIQ==";
$filename = "./leader.p12";
$passPhrase = "123";
$string_content = json_encode($item->toArray());
$aes = $utils->getAESKey($passowrdDess, $filename,$passPhrase);
$private_key = $utils->getPrivKey($filename,$passPhrase);
$encrypted_content = $utils->encrypt(base64_decode($aes), $string_content);
$signature = $utils->sign($encrypted_content,$private_key);
echo ($signature);
}
post();
//
//$api_url = 'https://example.com/api';
//
//// Data to be sent in the POST request
//$post_data = array(
// 'key1' => 'value1',
// 'key2' => 'value2',
// // Add more key-value pairs as needed
//);
//
//// Initialize cURL session
//$ch = curl_init($api_url);
//
//// Set cURL options
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return response as a string
//curl_setopt($ch, CURLOPT_POST, true); // Set as POST request
//curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); // Set POST data
//
//// Execute cURL session and store the response
//$response = curl_exec($ch);
//
//// Check for cURL errors
//if (curl_errno($ch)) {
// echo 'Curl error: ' . curl_error($ch);
//}
//
//// Close cURL session
//curl_close($ch);
//
//// Handle the response as needed
//echo $response;
?>