xref: /PHP-8.1/ext/openssl/openssl.stub.php (revision c8218867)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @strict-properties
7 * @not-serializable
8 */
9final class OpenSSLCertificate
10{
11}
12
13/**
14 * @strict-properties
15 * @not-serializable
16 */
17final class OpenSSLCertificateSigningRequest
18{
19}
20
21/**
22 * @strict-properties
23 * @not-serializable
24 */
25final class OpenSSLAsymmetricKey
26{
27}
28
29function openssl_x509_export_to_file(OpenSSLCertificate|string $certificate, string $output_filename, bool $no_text = true): bool {}
30
31/** @param string $output */
32function openssl_x509_export(OpenSSLCertificate|string $certificate, &$output, bool $no_text = true): bool {}
33
34function openssl_x509_fingerprint(OpenSSLCertificate|string $certificate, string $digest_algo = "sha1", bool $binary = false): string|false {}
35
36/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
37function openssl_x509_check_private_key(OpenSSLCertificate|string $certificate, $private_key): bool {}
38
39/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key */
40function openssl_x509_verify(OpenSSLCertificate|string $certificate, $public_key): int {}
41
42/**
43 * @return array<string, int|string|array>|false
44 * @refcount 1
45 */
46function openssl_x509_parse(OpenSSLCertificate|string $certificate, bool $short_names = true): array|false {}
47
48function openssl_x509_checkpurpose(OpenSSLCertificate|string $certificate, int $purpose, array $ca_info = [], ?string $untrusted_certificates_file = null): bool|int {}
49
50function openssl_x509_read(OpenSSLCertificate|string $certificate): OpenSSLCertificate|false {}
51
52/** @deprecated */
53function openssl_x509_free(OpenSSLCertificate $certificate): void {}
54
55/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
56function openssl_pkcs12_export_to_file(OpenSSLCertificate|string $certificate, string $output_filename, $private_key, string $passphrase, array $options = []): bool {}
57
58/**
59 * @param string $output
60 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
61 */
62function openssl_pkcs12_export(OpenSSLCertificate|string $certificate, &$output, $private_key, string $passphrase, array $options = []): bool {}
63
64/** @param array $certificates */
65function openssl_pkcs12_read(string $pkcs12, &$certificates, string $passphrase): bool {}
66
67function openssl_csr_export_to_file(OpenSSLCertificateSigningRequest|string $csr, string $output_filename, bool $no_text = true): bool {}
68
69/** @param string $output */
70function openssl_csr_export(OpenSSLCertificateSigningRequest|string $csr, &$output, bool $no_text = true): bool {}
71
72/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
73function openssl_csr_sign(OpenSSLCertificateSigningRequest|string $csr, OpenSSLCertificate|string|null $ca_certificate, $private_key, int $days, ?array $options = null, int $serial = 0): OpenSSLCertificate|false {}
74
75/** @param OpenSSLAsymmetricKey $private_key */
76function openssl_csr_new(array $distinguished_names, &$private_key, ?array $options = null, ?array $extra_attributes = null): OpenSSLCertificateSigningRequest|false {}
77
78/**
79 * @return array<string, string|array>|false
80 * @refcount 1
81 */
82function openssl_csr_get_subject(OpenSSLCertificateSigningRequest|string $csr, bool $short_names = true): array|false {}
83
84function openssl_csr_get_public_key(OpenSSLCertificateSigningRequest|string $csr, bool $short_names = true): OpenSSLAsymmetricKey|false {}
85
86function openssl_pkey_new(?array $options = null): OpenSSLAsymmetricKey|false {}
87
88/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $key */
89function openssl_pkey_export_to_file($key, string $output_filename, ?string $passphrase = null, ?array $options = null): bool {}
90
91/**
92 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $key
93 * @param string $output
94 */
95function openssl_pkey_export($key, &$output, ?string $passphrase = null, ?array $options = null): bool {}
96
97/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key */
98function openssl_pkey_get_public($public_key): OpenSSLAsymmetricKey|false {}
99
100/**
101 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key
102 * @alias openssl_pkey_get_public
103 */
104function openssl_get_publickey($public_key): OpenSSLAsymmetricKey|false {}
105
106/** @deprecated */
107function openssl_pkey_free(OpenSSLAsymmetricKey $key): void {}
108
109/**
110 * @alias openssl_pkey_free
111 * @deprecated
112 */
113function openssl_free_key(OpenSSLAsymmetricKey $key): void {}
114
115/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
116function openssl_pkey_get_private($private_key, ?string $passphrase = null): OpenSSLAsymmetricKey|false {}
117
118/**
119 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
120 * @alias openssl_pkey_get_private
121 */
122function openssl_get_privatekey($private_key, ?string $passphrase = null): OpenSSLAsymmetricKey|false {}
123
124/**
125 * @return array<string, int|string|array>|false
126 * @refcount 1
127 */
128function openssl_pkey_get_details(OpenSSLAsymmetricKey $key): array|false {}
129
130function openssl_pbkdf2(string $password, string $salt, int $key_length, int $iterations, string $digest_algo = "sha1"): string|false {}
131
132function openssl_pkcs7_verify(string $input_filename, int $flags, ?string $signers_certificates_filename = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $output_filename = null): bool|int {}
133
134/** @param OpenSSLCertificate|array|string $certificate */
135function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_AES_128_CBC): bool {}
136
137/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
138function openssl_pkcs7_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = PKCS7_DETACHED, ?string $untrusted_certificates_filename = null): bool {}
139
140/**
141 * @param OpenSSLCertificate|string $certificate
142 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string|null $private_key
143 */
144function openssl_pkcs7_decrypt(string $input_filename, string $output_filename, $certificate, $private_key = null): bool {}
145
146/** @param array $certificates */
147function openssl_pkcs7_read(string $data, &$certificates): bool {}
148
149function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
150
151/** @param OpenSSLCertificate|array|string $certificate */
152function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algo = OPENSSL_CIPHER_AES_128_CBC): bool {}
153
154/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */
155function openssl_cms_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, ?string $untrusted_certificates_filename = null): bool {}
156
157/**
158 * @param OpenSSLCertificate|string $certificate
159 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string|null $private_key
160 */
161function openssl_cms_decrypt(string $input_filename, string $output_filename, $certificate, $private_key = null, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
162
163/** @param array $certificates */
164function openssl_cms_read(string $input_filename, &$certificates): bool {}
165
166/**
167 * @param string $encrypted_data
168 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
169 */
170function openssl_private_encrypt(string $data, &$encrypted_data, $private_key, int $padding = OPENSSL_PKCS1_PADDING): bool {}
171
172/**
173 * @param string $decrypted_data
174 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
175 */
176function openssl_private_decrypt(string $data, &$decrypted_data, $private_key, int $padding = OPENSSL_PKCS1_PADDING): bool {}
177
178/**
179 * @param string $encrypted_data
180 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key
181 */
182function openssl_public_encrypt(string $data, &$encrypted_data, $public_key, int $padding = OPENSSL_PKCS1_PADDING): bool {}
183
184/**
185 * @param string $decrypted_data
186 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key
187 */
188function openssl_public_decrypt(string $data, &$decrypted_data, $public_key, int $padding = OPENSSL_PKCS1_PADDING): bool {}
189
190function openssl_error_string(): string|false {}
191
192/**
193 * @param string $signature
194 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
195 */
196function openssl_sign(string $data, &$signature, $private_key, string|int $algorithm = OPENSSL_ALGO_SHA1): bool {}
197
198/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key */
199function openssl_verify(string $data, string $signature, $public_key, string|int $algorithm = OPENSSL_ALGO_SHA1): int|false {}
200
201/**
202 * @param string $sealed_data
203 * @param array $encrypted_keys
204 * @param string $iv
205 */
206function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $public_key, string $cipher_algo, &$iv = null): int|false {}
207
208/**
209 * @param string $output
210 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
211 */
212function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algo, ?string $iv = null): bool {}
213
214/**
215 * @return array<int, string>
216 * @refcount 1
217 */
218function openssl_get_md_methods(bool $aliases = false): array {}
219
220/**
221 * @return array<int, string>
222 * @refcount 1
223 */
224function openssl_get_cipher_methods(bool $aliases = false): array {}
225
226#ifdef HAVE_EVP_PKEY_EC
227/**
228 * @return array<int, string>|false
229 * @refcount 1
230 */
231function openssl_get_curve_names(): array|false {}
232#endif
233
234function openssl_digest(string $data, string $digest_algo, bool $binary = false): string|false {}
235
236/** @param string $tag */
237function openssl_encrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", &$tag = null, string $aad = "", int $tag_length = 16): string|false {}
238
239function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", ?string $tag = null, string $aad = ""): string|false {}
240
241function openssl_cipher_iv_length(string $cipher_algo): int|false {}
242
243function openssl_dh_compute_key(string $public_key, OpenSSLAsymmetricKey $private_key): string|false {}
244
245/**
246 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $public_key
247 * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key
248 */
249function openssl_pkey_derive($public_key, $private_key, int $key_length = 0): string|false {}
250
251/** @param bool $strong_result */
252function openssl_random_pseudo_bytes(int $length, &$strong_result = null): string {}
253
254function openssl_spki_new(OpenSSLAsymmetricKey $private_key, string $challenge, int $digest_algo = OPENSSL_ALGO_MD5): string|false {}
255
256function openssl_spki_verify(string $spki): bool {}
257
258function openssl_spki_export(string $spki): string|false {}
259
260function openssl_spki_export_challenge(string $spki): string|false {}
261
262/**
263 * @return array<string, string>
264 * @refcount 1
265 */
266function openssl_get_cert_locations(): array {}
267