Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F628875
clientEncryption-createDataKey-002.phpt
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
936 B
Referenced Files
None
Subscribers
None
clientEncryption-createDataKey-002.phpt
View Options
--TEST--
MongoDB\Driver\ClientEncryption::createDataKey() "keyAltNames" option
--SKIPIF--
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
<?php skip_if_not_libmongocrypt(); ?>
<?php skip_if_not_live(); ?>
<?php skip_if_not_clean(CSFLE_KEY_VAULT_DATABASE_NAME, CSFLE_KEY_VAULT_COLLECTION_NAME);
--FILE--
<?php
require_once __DIR__ . "/../utils/basic.inc";
$manager = create_test_manager();
$clientEncryption = $manager->createClientEncryption([
'keyVaultNamespace' => CSFLE_KEY_VAULT_NS,
'kmsProviders' => ['local' => ['key' => new MongoDB\BSON\Binary(CSFLE_LOCAL_KEY, 0)]],
]);
$keyId = $clientEncryption->createDataKey('local', ['keyAltNames' => ['foo', 'bar']]);
$key = $clientEncryption->getKey($keyId);
var_dump($key->_id == $keyId);
var_dump(in_array('foo', $key->keyAltNames));
var_dump(in_array('bar', $key->keyAltNames));
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(true)
bool(true)
bool(true)
===DONE===
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 5:25 AM (45 m, 35 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
129222
Default Alt Text
clientEncryption-createDataKey-002.phpt (936 B)
Attached To
Mode
R114 php-mongodb
Attached
Detach File
Event Timeline