Debian Codegraph @

codelitephp/resources/cc/openssl.php

raw
1 <?php
2
3 // Start of openssl v.
4
5 /**
6 * Retrieve the available certificate locations
7 * @link http://www.php.net/manual/en/function.openssl-get-cert-locations.php
8 * @return array an array with the available certificate locations.
9 */
10 function openssl_get_cert_locations () {}
11
12 /**
13 * Generate a new signed public key and challenge
14 * @link http://www.php.net/manual/en/function.openssl-spki-new.php
15 * @param privkey
16 * @param challenge
17 * @param algo[optional]
18 */
19 function openssl_spki_new ($privkey, $challenge, $algo) {}
20
21 /**
22 * Verifies a signed public key and challenge
23 * @link http://www.php.net/manual/en/function.openssl-spki-verify.php
24 * @param spki
25 */
26 function openssl_spki_verify ($spki) {}
27
28 /**
29 * Exports a valid PEM formatted public key signed public key and challenge
30 * @link http://www.php.net/manual/en/function.openssl-spki-export.php
31 * @param spki
32 */
33 function openssl_spki_export ($spki) {}
34
35 /**
36 * Exports the challenge assoicated with a signed public key and challenge
37 * @link http://www.php.net/manual/en/function.openssl-spki-export-challenge.php
38 * @param spki
39 */
40 function openssl_spki_export_challenge ($spki) {}
41
42 /**
43 * Frees a private key
44 * @link http://www.php.net/manual/en/function.openssl-pkey-free.php
45 * @param key resource <p>
46 * Resource holding the key.
47 * </p>
48 * @return void
49 */
50 function openssl_pkey_free ($key) {}
51
52 /**
53 * Generates a new private key
54 * @link http://www.php.net/manual/en/function.openssl-pkey-new.php
55 * @param configargs array[optional] <p>
56 * You can finetune the key generation (such as specifying the number of
57 * bits) using configargs. See
58 * openssl_csr_new for more information about
59 * configargs.
60 * </p>
61 * @return resource a resource identifier for the pkey on success, or false on
62 * error.
63 */
64 function openssl_pkey_new (array $configargs = null) {}
65
66 /**
67 * Gets an exportable representation of a key into a string
68 * @link http://www.php.net/manual/en/function.openssl-pkey-export.php
69 * @param key mixed <p>
70 * </p>
71 * @param out string <p>
72 * </p>
73 * @param passphrase string[optional] <p>
74 * The key is optionally protected by passphrase.
75 * </p>
76 * @param configargs array[optional] <p>
77 * configargs can be used to fine-tune the export
78 * process by specifying and/or overriding options for the openssl
79 * configuration file. See openssl_csr_new for more
80 * information about configargs.
81 * </p>
82 * @return bool Returns true on success, false on failure.
83 */
84 function openssl_pkey_export ($key, &$out, $passphrase = null, array $configargs = null) {}
85
86 /**
87 * Gets an exportable representation of a key into a file
88 * @link http://www.php.net/manual/en/function.openssl-pkey-export-to-file.php
89 * @param key mixed <p>
90 * </p>
91 * @param outfilename string <p>
92 * Path to the output file.
93 * </p>
94 * @param passphrase string[optional] <p>
95 * The key can be optionally protected by a
96 * passphrase.
97 * </p>
98 * @param configargs array[optional] <p>
99 * configargs can be used to fine-tune the export
100 * process by specifying and/or overriding options for the openssl
101 * configuration file. See openssl_csr_new for more
102 * information about configargs.
103 * </p>
104 * @return bool Returns true on success, false on failure.
105 */
106 function openssl_pkey_export_to_file ($key, $outfilename, $passphrase = null, array $configargs = null) {}
107
108 /**
109 * Get a private key
110 * @link http://www.php.net/manual/en/function.openssl-pkey-get-private.php
111 * @param key mixed <p>
112 * key can be one of the following:
113 *
114 * a string having the format
115 * file://path/to/file.pem. The named file must
116 * contain a PEM encoded certificate/private key (it may contain both).
117 * @param passphrase string[optional] <p>
118 * The optional parameter passphrase must be used
119 * if the specified key is encrypted (protected by a passphrase).
120 * </p>
121 * @return resource a positive key resource identifier on success, or false on error.
122 */
123 function openssl_pkey_get_private ($key, $passphrase = null) {}
124
125 /**
126 * Extract public key from certificate and prepare it for use
127 * @link http://www.php.net/manual/en/function.openssl-pkey-get-public.php
128 * @param certificate mixed <p>
129 * certificate can be one of the following:
130 *
131 * an X.509 certificate resource
132 * @return resource a positive key resource identifier on success, or false on error.
133 */
134 function openssl_pkey_get_public ($certificate) {}
135
136 /**
137 * Returns an array with the key details
138 * @link http://www.php.net/manual/en/function.openssl-pkey-get-details.php
139 * @param key resource <p>
140 * Resource holding the key.
141 * </p>
142 * @return array an array with the key details in success or false in failure.
143 * Returned array has indexes bits (number of bits),
144 * key (string representation of the public key) and
145 * type (type of the key which is one of
146 * OPENSSL_KEYTYPE_RSA,
147 * OPENSSL_KEYTYPE_DSA,
148 * OPENSSL_KEYTYPE_DH,
149 * OPENSSL_KEYTYPE_EC or -1 meaning unknown).
150 * </p>
151 * <p>
152 * Depending on the key type used, additional details may be returned. Note that
153 * some elements may not always be available.
154 */
155 function openssl_pkey_get_details ($key) {}
156
157 /**
158 * Free key resource
159 * @link http://www.php.net/manual/en/function.openssl-free-key.php
160 * @param key_identifier resource <p>
161 * </p>
162 * @return void
163 */
164 function openssl_free_key ($key_identifier) {}
165
166 /**
167 * &Alias; <function>openssl_pkey_get_private</function>
168 * @link http://www.php.net/manual/en/function.openssl-get-privatekey.php
169 * @param key
170 * @param passphrase[optional]
171 */
172 function openssl_get_privatekey ($key, $passphrase) {}
173
174 /**
175 * &Alias; <function>openssl_pkey_get_public</function>
176 * @link http://www.php.net/manual/en/function.openssl-get-publickey.php
177 * @param cert
178 */
179 function openssl_get_publickey ($cert) {}
180
181 /**
182 * Parse an X.509 certificate and return a resource identifier for
183 it
184 * @link http://www.php.net/manual/en/function.openssl-x509-read.php
185 * @param x509certdata mixed <p>
186 * </p>
187 * @return resource a resource identifier on success&return.falseforfailure;.
188 */
189 function openssl_x509_read ($x509certdata) {}
190
191 /**
192 * Free certificate resource
193 * @link http://www.php.net/manual/en/function.openssl-x509-free.php
194 * @param x509cert resource <p>
195 * </p>
196 * @return void
197 */
198 function openssl_x509_free ($x509cert) {}
199
200 /**
201 * Parse an X509 certificate and return the information as an array
202 * @link http://www.php.net/manual/en/function.openssl-x509-parse.php
203 * @param x509cert mixed <p>
204 * </p>
205 * @param shortnames bool[optional] <p>
206 * shortnames controls how the data is indexed in the
207 * array - if shortnames is true (the default) then
208 * fields will be indexed with the short name form, otherwise, the long name
209 * form will be used - e.g.: CN is the shortname form of commonName.
210 * </p>
211 * @return array The structure of the returned data is (deliberately) not
212 * yet documented, as it is still subject to change.
213 */
214 function openssl_x509_parse ($x509cert, $shortnames = null) {}
215
216 /**
217 * Verifies if a certificate can be used for a particular purpose
218 * @link http://www.php.net/manual/en/function.openssl-x509-checkpurpose.php
219 * @param x509cert mixed <p>
220 * The examined certificate.
221 * </p>
222 * @param purpose int <p>
223 * <table>
224 * openssl_x509_checkpurpose purposes
225 *
226 *
227 * <tr valign="top">
228 * <td>Constant</td>
229 * <td>Description</td>
230 * </tr>
231 *
232 *
233 * <tr valign="top">
234 * <td>X509_PURPOSE_SSL_CLIENT</td>
235 * <td>Can the certificate be used for the client side of an SSL
236 * connection?</td>
237 * </tr>
238 * <tr valign="top">
239 * <td>X509_PURPOSE_SSL_SERVER</td>
240 * <td>Can the certificate be used for the server side of an SSL
241 * connection?</td>
242 * </tr>
243 * <tr valign="top">
244 * <td>X509_PURPOSE_NS_SSL_SERVER</td>
245 * <td>Can the cert be used for Netscape SSL server?</td>
246 * </tr>
247 * <tr valign="top">
248 * <td>X509_PURPOSE_SMIME_SIGN</td>
249 * <td>Can the cert be used to sign S/MIME email?</td>
250 * </tr>
251 * <tr valign="top">
252 * <td>X509_PURPOSE_SMIME_ENCRYPT</td>
253 * <td>Can the cert be used to encrypt S/MIME email?</td>
254 * </tr>
255 * <tr valign="top">
256 * <td>X509_PURPOSE_CRL_SIGN</td>
257 * <td>Can the cert be used to sign a certificate revocation list
258 * (CRL)?</td>
259 * </tr>
260 * <tr valign="top">
261 * <td>X509_PURPOSE_ANY</td>
262 * <td>Can the cert be used for Any/All purposes?</td>
263 * </tr>
264 *
265 *
266 * </table>
267 * These options are not bitfields - you may specify one only!
268 * </p>
269 * @param cainfo array[optional] <p>
270 * cainfo should be an array of trusted CA files/dirs
271 * as described in Certificate
272 * Verification.
273 * </p>
274 * @param untrustedfile string[optional] <p>
275 * If specified, this should be the name of a PEM encoded file holding
276 * certificates that can be used to help verify the certificate, although
277 * no trust is placed in the certificates that come from that file.
278 * </p>
279 * @return int true if the certificate can be used for the intended purpose,
280 * false if it cannot, or -1 on error.
281 */
282 function openssl_x509_checkpurpose ($x509cert, $purpose, array $cainfo = null, $untrustedfile = null) {}
283
284 /**
285 * Checks if a private key corresponds to a certificate
286 * @link http://www.php.net/manual/en/function.openssl-x509-check-private-key.php
287 * @param cert mixed <p>
288 * The certificate.
289 * </p>
290 * @param key mixed <p>
291 * The private key.
292 * </p>
293 * @return bool true if key is the private key that
294 * corresponds to cert, or false otherwise.
295 */
296 function openssl_x509_check_private_key ($cert, $key) {}
297
298 /**
299 * Exports a certificate as a string
300 * @link http://www.php.net/manual/en/function.openssl-x509-export.php
301 * @param x509 mixed
302 * @param output string <p>
303 * On success, this will hold the PEM.
304 * </p>
305 * @param notext bool[optional] &note.openssl.param-notext;
306 * @return bool Returns true on success, false on failure.
307 */
308 function openssl_x509_export ($x509, &$output, $notext = null) {}
309
310 /**
311 * Calculates the fingerprint, or digest, of a given X.509 certificate
312 * @link http://www.php.net/manual/en/function.openssl-x509-fingerprint.php
313 * @param x509 mixed
314 * @param hash_algorithm string[optional] <p>
315 * The hash algorithm to use, e.g. "md5" or "sha1"
316 * </p>
317 * @param raw_output bool[optional] <p>
318 * When set to true, outputs raw binary data. false outputs lowercase hexits.
319 * </p>
320 * @return bool a string containing the calculated certificate fingerprint as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.
321 * </p>
322 * <p>
323 * Returns false on failure.
324 */
325 function openssl_x509_fingerprint ($x509, $hash_algorithm = null, $raw_output = null) {}
326
327 /**
328 * Exports a certificate to file
329 * @link http://www.php.net/manual/en/function.openssl-x509-export-to-file.php
330 * @param x509 mixed
331 * @param outfilename string <p>
332 * Path to the output file.
333 * </p>
334 * @param notext bool[optional] &note.openssl.param-notext;
335 * @return bool Returns true on success, false on failure.
336 */
337 function openssl_x509_export_to_file ($x509, $outfilename, $notext = null) {}
338
339 /**
340 * Exports a PKCS#12 Compatible Certificate Store File to variable.
341 * @link http://www.php.net/manual/en/function.openssl-pkcs12-export.php
342 * @param x509 mixed
343 * @param out string <p>
344 * On success, this will hold the PKCS#12.
345 * </p>
346 * @param priv_key mixed <p>
347 * Private key component of PKCS#12 file.
348 * </p>
349 * @param pass string <p>
350 * Encryption password for unlocking the PKCS#12 file.
351 * </p>
352 * @param args array[optional] <p>
353 * </p>
354 * @return bool Returns true on success, false on failure.
355 */
356 function openssl_pkcs12_export ($x509, &$out, $priv_key, $pass, array $args = null) {}
357
358 /**
359 * Exports a PKCS#12 Compatible Certificate Store File
360 * @link http://www.php.net/manual/en/function.openssl-pkcs12-export-to-file.php
361 * @param x509 mixed
362 * @param filename string <p>
363 * Path to the output file.
364 * </p>
365 * @param priv_key mixed <p>
366 * Private key component of PKCS#12 file.
367 * </p>
368 * @param pass string <p>
369 * Encryption password for unlocking the PKCS#12 file.
370 * </p>
371 * @param args array[optional] <p>
372 * </p>
373 * @return bool Returns true on success, false on failure.
374 */
375 function openssl_pkcs12_export_to_file ($x509, $filename, $priv_key, $pass, array $args = null) {}
376
377 /**
378 * Parse a PKCS#12 Certificate Store into an array
379 * @link http://www.php.net/manual/en/function.openssl-pkcs12-read.php
380 * @param pkcs12 string <p>
381 * </p>
382 * @param certs array <p>
383 * On success, this will hold the Certificate Store Data.
384 * </p>
385 * @param pass string <p>
386 * Encryption password for unlocking the PKCS#12 file.
387 * </p>
388 * @return bool Returns true on success, false on failure.
389 */
390 function openssl_pkcs12_read ($pkcs12, array &$certs, $pass) {}
391
392 /**
393 * Generates a CSR
394 * @link http://www.php.net/manual/en/function.openssl-csr-new.php
395 * @param dn array <p>
396 * The Distinguished Name to be used in the certificate.
397 * </p>
398 * @param privkey resource <p>
399 * privkey should be set to a private key that was
400 * previously generated by openssl_pkey_new (or
401 * otherwise obtained from the other openssl_pkey family of functions).
402 * The corresponding public portion of the key will be used to sign the
403 * CSR.
404 * </p>
405 * @param configargs array[optional] <p>
406 * By default, the information in your system openssl.conf
407 * is used to initialize the request; you can specify a configuration file
408 * section by setting the config_section_section key of
409 * configargs. You can also specify an alternative
410 * openssl configuration file by setting the value of the
411 * config key to the path of the file you want to use.
412 * The following keys, if present in configargs
413 * behave as their equivalents in the openssl.conf, as
414 * listed in the table below.
415 * <table>
416 * Configuration overrides
417 *
418 *
419 * <tr valign="top">
420 * <td>configargs key</td>
421 * <td>type</td>
422 * <td>openssl.conf equivalent</td>
423 * <td>description</td>
424 * </tr>
425 *
426 *
427 * <tr valign="top">
428 * <td>digest_alg</td>
429 * <td>string</td>
430 * <td>default_md</td>
431 * <td>Selects which digest method to use</td>
432 * </tr>
433 * <tr valign="top">
434 * <td>x509_extensions</td>
435 * <td>string</td>
436 * <td>x509_extensions</td>
437 * <td>Selects which extensions should be used when creating an x509
438 * certificate</td>
439 * </tr>
440 * <tr valign="top">
441 * <td>req_extensions</td>
442 * <td>string</td>
443 * <td>req_extensions</td>
444 * <td>Selects which extensions should be used when creating a CSR</td>
445 * </tr>
446 * <tr valign="top">
447 * <td>private_key_bits</td>
448 * <td>integer</td>
449 * <td>default_bits</td>
450 * <td>Specifies how many bits should be used to generate a private
451 * key</td>
452 * </tr>
453 * <tr valign="top">
454 * <td>private_key_type</td>
455 * <td>integer</td>
456 * <td>none</td>
457 * <td>Specifies the type of private key to create. This can be one
458 * of OPENSSL_KEYTYPE_DSA,
459 * OPENSSL_KEYTYPE_DH or
460 * OPENSSL_KEYTYPE_RSA.
461 * The default value is OPENSSL_KEYTYPE_RSA which
462 * is currently the only supported key type.
463 * </td>
464 * </tr>
465 * <tr valign="top">
466 * <td>encrypt_key</td>
467 * <td>boolean</td>
468 * <td>encrypt_key</td>
469 * <td>Should an exported key (with passphrase) be encrypted?</td>
470 * </tr>
471 * <tr valign="top">
472 * <td>encrypt_key_cipher</td>
473 * <td>integer</td>
474 * <td>none</td>
475 * <td>
476 * One of cipher constants.
477 * </td>
478 * </tr>
479 *
480 *
481 * </table>
482 * </p>
483 * @param extraattribs array[optional] <p>
484 * extraattribs is used to specify additional
485 * configuration options for the CSR. Both dn and
486 * extraattribs are associative arrays whose keys are
487 * converted to OIDs and applied to the relevant part of the request.
488 * </p>
489 * @return mixed the CSR.
490 */
491 function openssl_csr_new (array $dn, &$privkey, array $configargs = null, array $extraattribs = null) {}
492
493 /**
494 * Exports a CSR as a string
495 * @link http://www.php.net/manual/en/function.openssl-csr-export.php
496 * @param csr resource <p>
497 * </p>
498 * @param out string <p>
499 * </p>
500 * @param notext bool[optional] &note.openssl.param-notext;
501 * @return bool Returns true on success, false on failure.
502 */
503 function openssl_csr_export ($csr, &$out, $notext = null) {}
504
505 /**
506 * Exports a CSR to a file
507 * @link http://www.php.net/manual/en/function.openssl-csr-export-to-file.php
508 * @param csr resource <p>
509 * </p>
510 * @param outfilename string <p>
511 * Path to the output file.
512 * </p>
513 * @param notext bool[optional] &note.openssl.param-notext;
514 * @return bool Returns true on success, false on failure.
515 */
516 function openssl_csr_export_to_file ($csr, $outfilename, $notext = null) {}
517
518 /**
519 * Sign a CSR with another certificate (or itself) and generate a certificate
520 * @link http://www.php.net/manual/en/function.openssl-csr-sign.php
521 * @param csr mixed <p>
522 * A CSR previously generated by openssl_csr_new.
523 * It can also be the path to a PEM encoded CSR when specified as
524 * file://path/to/csr or an exported string generated
525 * by openssl_csr_export.
526 * </p>
527 * @param cacert mixed <p>
528 * The generated certificate will be signed by cacert.
529 * If cacert is &null;, the generated certificate
530 * will be a self-signed certificate.
531 * </p>
532 * @param priv_key mixed <p>
533 * priv_key is the private key that corresponds to
534 * cacert.
535 * </p>
536 * @param days int <p>
537 * days specifies the length of time for which the
538 * generated certificate will be valid, in days.
539 * </p>
540 * @param configargs array[optional] <p>
541 * You can finetune the CSR signing by configargs.
542 * See openssl_csr_new for more information about
543 * configargs.
544 * </p>
545 * @param serial int[optional] <p>
546 * An optional the serial number of issued certificate. If not specified
547 * it will default to 0.
548 * </p>
549 * @return resource an x509 certificate resource on success, false on failure.
550 */
551 function openssl_csr_sign ($csr, $cacert, $priv_key, $days, array $configargs = null, $serial = null) {}
552
553 /**
554 * Returns the subject of a CERT
555 * @link http://www.php.net/manual/en/function.openssl-csr-get-subject.php
556 * @param csr mixed
557 * @param use_shortnames bool[optional]
558 * @return array
559 */
560 function openssl_csr_get_subject ($csr, $use_shortnames = null) {}
561
562 /**
563 * Returns the public key of a CERT
564 * @link http://www.php.net/manual/en/function.openssl-csr-get-public-key.php
565 * @param csr mixed
566 * @param use_shortnames bool[optional]
567 * @return resource
568 */
569 function openssl_csr_get_public_key ($csr, $use_shortnames = null) {}
570
571 /**
572 * Computes a digest
573 * @link http://www.php.net/manual/en/function.openssl-digest.php
574 * @param data string <p>
575 * The data.
576 * </p>
577 * @param method string <p>
578 * The digest method.
579 * </p>
580 * @param raw_output bool[optional] <p>
581 * Setting to true will return as raw output data, otherwise the return
582 * value is binhex encoded.
583 * </p>
584 * @return string the digested hash value on success&return.falseforfailure;.
585 */
586 function openssl_digest ($data, $method, $raw_output = null) {}
587
588 /**
589 * Encrypts data
590 * @link http://www.php.net/manual/en/function.openssl-encrypt.php
591 * @param data string <p>
592 * The data.
593 * </p>
594 * @param method string <p>
595 * The cipher method.
596 * </p>
597 * @param password string <p>
598 * The password.
599 * </p>
600 * @param options int[optional] <p>
601 * options can be one of
602 * OPENSSL_RAW_DATA,
603 * OPENSSL_ZERO_PADDING.
604 * </p>
605 * @param iv string[optional] <p>
606 * A non-NULL Initialization Vector.
607 * </p>
608 * @return string the encrypted string on success&return.falseforfailure;.
609 */
610 function openssl_encrypt ($data, $method, $password, $options = null, $iv = null) {}
611
612 /**
613 * Decrypts data
614 * @link http://www.php.net/manual/en/function.openssl-decrypt.php
615 * @param data string <p>
616 * The data.
617 * </p>
618 * @param method string <p>
619 * The cipher method.
620 * </p>
621 * @param password string <p>
622 * The password.
623 * </p>
624 * @param options int[optional] <p>
625 * options can be one of
626 * OPENSSL_RAW_DATA,
627 * OPENSSL_ZERO_PADDING.
628 * </p>
629 * @param iv string[optional] <p>
630 * A non-NULL Initialization Vector.
631 * </p>
632 * @return string The decrypted string on success&return.falseforfailure;.
633 */
634 function openssl_decrypt ($data, $method, $password, $options = null, $iv = null) {}
635
636 /**
637 * Gets the cipher iv length
638 * @link http://www.php.net/manual/en/function.openssl-cipher-iv-length.php
639 * @param method string <p>
640 * The cipher method, see openssl_get_cipher_methods for a list of potential values.
641 * </p>
642 * @return int the cipher length on success, or false on failure.
643 */
644 function openssl_cipher_iv_length ($method) {}
645
646 /**
647 * Generate signature
648 * @link http://www.php.net/manual/en/function.openssl-sign.php
649 * @param data string <p>
650 * The string of data you wish to sign
651 * </p>
652 * @param signature string <p>
653 * If the call was successful the signature is returned in
654 * signature.
655 * </p>
656 * @param priv_key_id mixed <p>
657 * resource - a key, returned by openssl_get_privatekey
658 * </p>
659 * <p>
660 * string - a PEM formatted key
661 * </p>
662 * @param signature_alg mixed[optional] <p>
663 * int - one of these Signature Algorithms.
664 * </p>
665 * <p>
666 * string - a valid string returned by openssl_get_md_methods example, "sha256WithRSAEncryption" or "sha384".
667 * </p>
668 * @return bool Returns true on success, false on failure.
669 */
670 function openssl_sign ($data, &$signature, $priv_key_id, $signature_alg = null) {}
671
672 /**
673 * Verify signature
674 * @link http://www.php.net/manual/en/function.openssl-verify.php
675 * @param data string <p>
676 * The string of data used to generate the signature previously
677 * </p>
678 * @param signature string <p>
679 * A raw binary string, generated by openssl_sign or similar means
680 * </p>
681 * @param pub_key_id mixed <p>
682 * resource - a key, returned by openssl_get_publickey
683 * </p>
684 * <p>
685 * string - a PEM formatted key, example, "-----BEGIN PUBLIC KEY-----
686 * MIIBCgK..."
687 * </p>
688 * @param signature_alg mixed[optional] <p>
689 * int - one of these Signature Algorithms.
690 * </p>
691 * <p>
692 * string - a valid string returned by openssl_get_md_methods example, "sha1WithRSAEncryption" or "sha512".
693 * </p>
694 * @return int 1 if the signature is correct, 0 if it is incorrect, and
695 * -1 on error.
696 */
697 function openssl_verify ($data, $signature, $pub_key_id, $signature_alg = null) {}
698
699 /**
700 * Seal (encrypt) data
701 * @link http://www.php.net/manual/en/function.openssl-seal.php
702 * @param data string <p>
703 * </p>
704 * @param sealed_data string <p>
705 * </p>
706 * @param env_keys array <p>
707 * </p>
708 * @param pub_key_ids array <p>
709 * </p>
710 * @param method string[optional]
711 * @return int the length of the sealed data on success, or false on error.
712 * If successful the sealed data is returned in
713 * sealed_data, and the envelope keys in
714 * env_keys.
715 */
716 function openssl_seal ($data, &$sealed_data, array &$env_keys, array $pub_key_ids, $method = null) {}
717
718 /**
719 * Open sealed data
720 * @link http://www.php.net/manual/en/function.openssl-open.php
721 * @param sealed_data string <p>
722 * </p>
723 * @param open_data string <p>
724 * If the call is successful the opened data is returned in this
725 * parameter.
726 * </p>
727 * @param env_key string <p>
728 * </p>
729 * @param priv_key_id mixed <p>
730 * </p>
731 * @param method string[optional]
732 * @return bool Returns true on success, false on failure.
733 */
734 function openssl_open ($sealed_data, &$open_data, $env_key, $priv_key_id, $method = null) {}
735
736 /**
737 * Generates a PKCS5 v2 PBKDF2 string, defaults to SHA-1
738 * @link http://www.php.net/manual/en/function.openssl-pbkdf2.php
739 * @param password string <p>
740 *
741 * </p>
742 * @param salt string <p>
743 *
744 * </p>
745 * @param key_length int <p>
746 *
747 * </p>
748 * @param iterations int <p>
749 *
750 * </p>
751 * @param digest_algorithm string[optional] <p>
752 *
753 * </p>
754 * @return string string&return.falseforfailure;.
755 */
756 function openssl_pbkdf2 ($password, $salt, $key_length, $iterations, $digest_algorithm = null) {}
757
758 /**
759 * Verifies the signature of an S/MIME signed message
760 * @link http://www.php.net/manual/en/function.openssl-pkcs7-verify.php
761 * @param filename string <p>
762 * Path to the message.
763 * </p>
764 * @param flags int <p>
765 * flags can be used to affect how the signature is
766 * verified - see PKCS7 constants
767 * for more information.
768 * </p>
769 * @param outfilename string[optional] <p>
770 * If the outfilename is specified, it should be a
771 * string holding the name of a file into which the certificates of the
772 * persons that signed the messages will be stored in PEM format.
773 * </p>
774 * @param cainfo array[optional] <p>
775 * If the cainfo is specified, it should hold
776 * information about the trusted CA certificates to use in the verification
777 * process - see certificate
778 * verification for more information about this parameter.
779 * </p>
780 * @param extracerts string[optional] <p>
781 * If the extracerts is specified, it is the filename
782 * of a file containing a bunch of certificates to use as untrusted CAs.
783 * </p>
784 * @param content string[optional] <p>
785 * You can specify a filename with content that will
786 * be filled with the verified data, but with the signature information
787 * stripped.
788 * </p>
789 * @return mixed true if the signature is verified, false if it is not correct
790 * (the message has been tampered with, or the signing certificate is invalid),
791 * or -1 on error.
792 */
793 function openssl_pkcs7_verify ($filename, $flags, $outfilename = null, array $cainfo = null, $extracerts = null, $content = null) {}
794
795 /**
796 * Decrypts an S/MIME encrypted message
797 * @link http://www.php.net/manual/en/function.openssl-pkcs7-decrypt.php
798 * @param infilename string <p>
799 * </p>
800 * @param outfilename string <p>
801 * The decrypted message is written to the file specified by
802 * outfilename.
803 * </p>
804 * @param recipcert mixed <p>
805 * </p>
806 * @param recipkey mixed[optional] <p>
807 * </p>
808 * @return bool Returns true on success, false on failure.
809 */
810 function openssl_pkcs7_decrypt ($infilename, $outfilename, $recipcert, $recipkey = null) {}
811
812 /**
813 * Sign an S/MIME message
814 * @link http://www.php.net/manual/en/function.openssl-pkcs7-sign.php
815 * @param infilename string <p>
816 * </p>
817 * @param outfilename string <p>
818 * </p>
819 * @param signcert mixed <p>
820 * </p>
821 * @param privkey mixed <p>
822 * </p>
823 * @param headers array <p>
824 * headers is an array of headers that
825 * will be prepended to the data after it has been signed (see
826 * openssl_pkcs7_encrypt for more information about
827 * the format of this parameter).
828 * </p>
829 * @param flags int[optional] <p>
830 * flags can be used to alter the output - see PKCS7 constants.
831 * </p>
832 * @param extracerts string[optional] <p>
833 * extracerts specifies the name of a file containing
834 * a bunch of extra certificates to include in the signature which can for
835 * example be used to help the recipient to verify the certificate that you used.
836 * </p>
837 * @return bool Returns true on success, false on failure.
838 */
839 function openssl_pkcs7_sign ($infilename, $outfilename, $signcert, $privkey, array $headers, $flags = null, $extracerts = null) {}
840
841 /**
842 * Encrypt an S/MIME message
843 * @link http://www.php.net/manual/en/function.openssl-pkcs7-encrypt.php
844 * @param infile string <p>
845 * </p>
846 * @param outfile string <p>
847 * </p>
848 * @param recipcerts mixed <p>
849 * Either a lone X.509 certificate, or an array of X.509 certificates.
850 * </p>
851 * @param headers array <p>
852 * headers is an array of headers that
853 * will be prepended to the data after it has been encrypted.
854 * </p>
855 * <p>
856 * headers can be either an associative array
857 * keyed by header name, or an indexed array, where each element contains
858 * a single header line.
859 * </p>
860 * @param flags int[optional] <p>
861 * flags can be used to specify options that affect
862 * the encoding process - see PKCS7
863 * constants.
864 * </p>
865 * @param cipherid int[optional] <p>
866 * One of cipher constants.
867 * </p>
868 * @return bool Returns true on success, false on failure.
869 */
870 function openssl_pkcs7_encrypt ($infile, $outfile, $recipcerts, array $headers, $flags = null, $cipherid = null) {}
871
872 /**
873 * Encrypts data with private key
874 * @link http://www.php.net/manual/en/function.openssl-private-encrypt.php
875 * @param data string <p>
876 * </p>
877 * @param crypted string <p>
878 * </p>
879 * @param key mixed <p>
880 * </p>
881 * @param padding int[optional] <p>
882 * padding can be one of
883 * OPENSSL_PKCS1_PADDING,
884 * OPENSSL_NO_PADDING.
885 * </p>
886 * @return bool Returns true on success, false on failure.
887 */
888 function openssl_private_encrypt ($data, &$crypted, $key, $padding = null) {}
889
890 /**
891 * Decrypts data with private key
892 * @link http://www.php.net/manual/en/function.openssl-private-decrypt.php
893 * @param data string <p>
894 * </p>
895 * @param decrypted string <p>
896 * </p>
897 * @param key mixed <p>
898 * key must be the private key corresponding that
899 * was used to encrypt the data.
900 * </p>
901 * @param padding int[optional] <p>
902 * padding can be one of
903 * OPENSSL_PKCS1_PADDING,
904 * OPENSSL_SSLV23_PADDING,
905 * OPENSSL_PKCS1_OAEP_PADDING,
906 * OPENSSL_NO_PADDING.
907 * </p>
908 * @return bool Returns true on success, false on failure.
909 */
910 function openssl_private_decrypt ($data, &$decrypted, $key, $padding = null) {}
911
912 /**
913 * Encrypts data with public key
914 * @link http://www.php.net/manual/en/function.openssl-public-encrypt.php
915 * @param data string <p>
916 * </p>
917 * @param crypted string <p>
918 * This will hold the result of the encryption.
919 * </p>
920 * @param key mixed <p>
921 * The public key.
922 * </p>
923 * @param padding int[optional] <p>
924 * padding can be one of
925 * OPENSSL_PKCS1_PADDING,
926 * OPENSSL_SSLV23_PADDING,
927 * OPENSSL_PKCS1_OAEP_PADDING,
928 * OPENSSL_NO_PADDING.
929 * </p>
930 * @return bool Returns true on success, false on failure.
931 */
932 function openssl_public_encrypt ($data, &$crypted, $key, $padding = null) {}
933
934 /**
935 * Decrypts data with public key
936 * @link http://www.php.net/manual/en/function.openssl-public-decrypt.php
937 * @param data string <p>
938 * </p>
939 * @param decrypted string <p>
940 * </p>
941 * @param key mixed <p>
942 * key must be the public key corresponding that
943 * was used to encrypt the data.
944 * </p>
945 * @param padding int[optional] <p>
946 * padding can be one of
947 * OPENSSL_PKCS1_PADDING,
948 * OPENSSL_NO_PADDING.
949 * </p>
950 * @return bool Returns true on success, false on failure.
951 */
952 function openssl_public_decrypt ($data, &$decrypted, $key, $padding = null) {}
953
954 /**
955 * Gets available digest methods
956 * @link http://www.php.net/manual/en/function.openssl-get-md-methods.php
957 * @param aliases bool[optional] <p>
958 * Set to true if digest aliases should be included within the
959 * returned array.
960 * </p>
961 * @return array An array of available digest methods.
962 */
963 function openssl_get_md_methods ($aliases = null) {}
964
965 /**
966 * Gets available cipher methods
967 * @link http://www.php.net/manual/en/function.openssl-get-cipher-methods.php
968 * @param aliases bool[optional] <p>
969 * Set to true if cipher aliases should be included within the
970 * returned array.
971 * </p>
972 * @return array An array of available cipher methods.
973 */
974 function openssl_get_cipher_methods ($aliases = null) {}
975
976 /**
977 * Computes shared secret for public value of remote DH key and local DH key
978 * @link http://www.php.net/manual/en/function.openssl-dh-compute-key.php
979 * @param pub_key string <p>
980 * Public key
981 * </p>
982 * @param dh_key resource <p>
983 * DH key
984 * </p>
985 * @return string computed key on success&return.falseforfailure;.
986 */
987 function openssl_dh_compute_key ($pub_key, $dh_key) {}
988
989 /**
990 * Generate a pseudo-random string of bytes
991 * @link http://www.php.net/manual/en/function.openssl-random-pseudo-bytes.php
992 * @param length int <p>
993 * The length of the desired string of bytes. Must be a positive integer. PHP will
994 * try to cast this parameter to a non-null integer to use it.
995 * </p>
996 * @param crypto_strong bool[optional] <p>
997 * If passed into the function, this will hold a boolean value that determines
998 * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG,
999 * passwords, etc. true if it did, otherwise false
1000 * </p>
1001 * @return string the generated &string; of bytes on success, &return.falseforfailure;.
1002 */
1003 function openssl_random_pseudo_bytes ($length, &$crypto_strong = null) {}
1004
1005 /**
1006 * Return openSSL error message
1007 * @link http://www.php.net/manual/en/function.openssl-error-string.php
1008 * @return string an error message string, or false if there are no more error
1009 * messages to return.
1010 */
1011 function openssl_error_string () {}
1012
1013 define ('OPENSSL_VERSION_TEXT', "OpenSSL 1.0.1e 11 Feb 2013");
1014 define ('OPENSSL_VERSION_NUMBER', 268439647);
1015 define ('X509_PURPOSE_SSL_CLIENT', 1);
1016 define ('X509_PURPOSE_SSL_SERVER', 2);
1017 define ('X509_PURPOSE_NS_SSL_SERVER', 3);
1018 define ('X509_PURPOSE_SMIME_SIGN', 4);
1019 define ('X509_PURPOSE_SMIME_ENCRYPT', 5);
1020 define ('X509_PURPOSE_CRL_SIGN', 6);
1021 define ('X509_PURPOSE_ANY', 7);
1022
1023 /**
1024 * Used as default algorithm by openssl_sign and
1025 * openssl_verify.
1026 * @link http://www.php.net/manual/en/openssl.constants.php
1027 */
1028 define ('OPENSSL_ALGO_SHA1', 1);
1029 define ('OPENSSL_ALGO_MD5', 2);
1030 define ('OPENSSL_ALGO_MD4', 3);
1031 define ('OPENSSL_ALGO_DSS1', 5);
1032 define ('OPENSSL_ALGO_SHA224', 6);
1033 define ('OPENSSL_ALGO_SHA256', 7);
1034 define ('OPENSSL_ALGO_SHA384', 8);
1035 define ('OPENSSL_ALGO_SHA512', 9);
1036 define ('OPENSSL_ALGO_RMD160', 10);
1037
1038 /**
1039 * When signing a message, use cleartext signing with the MIME
1040 * type "multipart/signed". This is the default
1041 * if you do not specify any flags to
1042 * openssl_pkcs7_sign.
1043 * If you turn this option off, the message will be signed using
1044 * opaque signing, which is more resistant to translation by mail relays
1045 * but cannot be read by mail agents that do not support S/MIME.
1046 * @link http://www.php.net/manual/en/openssl.constants.php
1047 */
1048 define ('PKCS7_DETACHED', 64);
1049
1050 /**
1051 * Adds text/plain content type headers to encrypted/signed
1052 * message. If decrypting or verifying, it strips those headers from
1053 * the output - if the decrypted or verified message is not of MIME type
1054 * text/plain then an error will occur.
1055 * @link http://www.php.net/manual/en/openssl.constants.php
1056 */
1057 define ('PKCS7_TEXT', 1);
1058
1059 /**
1060 * When verifying a message, certificates (if
1061 * any) included in the message are normally searched for the
1062 * signing certificate. With this option only the
1063 * certificates specified in the extracerts
1064 * parameter of openssl_pkcs7_verify are
1065 * used. The supplied certificates can still be used as
1066 * untrusted CAs however.
1067 * @link http://www.php.net/manual/en/openssl.constants.php
1068 */
1069 define ('PKCS7_NOINTERN', 16);
1070
1071 /**
1072 * Do not verify the signers certificate of a signed
1073 * message.
1074 * @link http://www.php.net/manual/en/openssl.constants.php
1075 */
1076 define ('PKCS7_NOVERIFY', 32);
1077
1078 /**
1079 * Do not chain verification of signers certificates: that is
1080 * don't use the certificates in the signed message as untrusted CAs.
1081 * @link http://www.php.net/manual/en/openssl.constants.php
1082 */
1083 define ('PKCS7_NOCHAIN', 8);
1084
1085 /**
1086 * When signing a message the signer's certificate is normally
1087 * included - with this option it is excluded. This will reduce the
1088 * size of the signed message but the verifier must have a copy of the
1089 * signers certificate available locally (passed using the
1090 * extracerts to
1091 * openssl_pkcs7_verify for example).
1092 * @link http://www.php.net/manual/en/openssl.constants.php
1093 */
1094 define ('PKCS7_NOCERTS', 2);
1095
1096 /**
1097 * Normally when a message is signed, a set of attributes are
1098 * included which include the signing time and the supported symmetric
1099 * algorithms. With this option they are not included.
1100 * @link http://www.php.net/manual/en/openssl.constants.php
1101 */
1102 define ('PKCS7_NOATTR', 256);
1103
1104 /**
1105 * Normally the input message is converted to "canonical" format
1106 * which is effectively using CR and LF
1107 * as end of line: as required by the S/MIME specification. When this
1108 * option is present, no translation occurs. This is useful when
1109 * handling binary data which may not be in MIME format.
1110 * @link http://www.php.net/manual/en/openssl.constants.php
1111 */
1112 define ('PKCS7_BINARY', 128);
1113
1114 /**
1115 * Don't try and verify the signatures on a message
1116 * @link http://www.php.net/manual/en/openssl.constants.php
1117 */
1118 define ('PKCS7_NOSIGS', 4);
1119 define ('OPENSSL_PKCS1_PADDING', 1);
1120 define ('OPENSSL_SSLV23_PADDING', 2);
1121 define ('OPENSSL_NO_PADDING', 3);
1122 define ('OPENSSL_PKCS1_OAEP_PADDING', 4);
1123 define ('OPENSSL_DEFAULT_STREAM_CIPHERS', "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:HIGH:!SSLv2:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!RC4:!ADH");
1124 define ('OPENSSL_CIPHER_RC2_40', 0);
1125 define ('OPENSSL_CIPHER_RC2_128', 1);
1126 define ('OPENSSL_CIPHER_RC2_64', 2);
1127 define ('OPENSSL_CIPHER_DES', 3);
1128 define ('OPENSSL_CIPHER_3DES', 4);
1129 define ('OPENSSL_CIPHER_AES_128_CBC', 5);
1130 define ('OPENSSL_CIPHER_AES_192_CBC', 6);
1131 define ('OPENSSL_CIPHER_AES_256_CBC', 7);
1132 define ('OPENSSL_KEYTYPE_RSA', 0);
1133 define ('OPENSSL_KEYTYPE_DSA', 1);
1134 define ('OPENSSL_KEYTYPE_DH', 2);
1135
1136 /**
1137 * This constant is only available when PHP is compiled with OpenSSL 0.9.8+.
1138 * @link http://www.php.net/manual/en/openssl.constants.php
1139 */
1140 define ('OPENSSL_KEYTYPE_EC', 3);
1141 define ('OPENSSL_RAW_DATA', 1);
1142 define ('OPENSSL_ZERO_PADDING', 2);
1143
1144 /**
1145 * Whether SNI support is available or not.
1146 * @link http://www.php.net/manual/en/openssl.constants.php
1147 */
1148 define ('OPENSSL_TLSEXT_SERVER_NAME', 1);
1149
1150 // End of openssl v.
1151 ?>