1--TEST--
2openssl_open() tests
3--EXTENSIONS--
4openssl
5--FILE--
6<?php
7$data = "openssl_open() test";
8$pub_key = "file://" . __DIR__ . "/public.key";
9$priv_key = "file://" . __DIR__ . "/private_rsa_1024.key";
10$wrong = "wrong";
11$method = "AES-128-ECB";
12
13openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key, $pub_key), $method);
14openssl_open($sealed, $output, $ekeys[0], $priv_key, $method);
15var_dump($output);
16openssl_open($sealed, $output2, $ekeys[1], $wrong, $method);
17var_dump($output2);
18openssl_open($sealed, $output3, $ekeys[2], $priv_key, $method);
19var_dump($output3);
20openssl_open($sealed, $output4, $wrong, $priv_key, $method);
21var_dump($output4);
22?>
23--EXPECTF--
24string(19) "openssl_open() test"
25
26Warning: openssl_open(): Unable to coerce parameter 4 into a private key in %s on line %d
27NULL
28string(19) "openssl_open() test"
29NULL
30