*     (3) Neither the name of the copyright holder nor the names of its
 *     contributors may be used to endorse or promote products derived from
 *     this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
require_once '../vendor/autoload.php';
use Virgil\SDK\Common\Utils\GUID, Virgil\SDK\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_UUID = 'aa2141ee-8a50-a7c4-3e4c-513b67918053';
const VIRGIL_CONFIRMATION_CODE = 'J9Y0D5';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN);
    // Do service call
    echo 'Call Keys service to confirm User Data.' . PHP_EOL;
    $keysClient->getUserDataClient()->persistUserData(VIRGIL_UUID, VIRGIL_CONFIRMATION_CODE);
    echo 'User Data successfully confirmed.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
예제 #2
0
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
require_once '../vendor/autoload.php';
use Virgil\SDK\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_UUID = 'aa2141ee-8a50-a7c4-3e4c-513b67918053';
const VIRGIL_PRIVATE_KEY_PASSWORD = '******';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN, array('base_url' => 'https://keys-stg.virgilsecurity.com'));
    $keysClient->setHeaders(array('X-VIRGIL-REQUEST-SIGN-PK-ID' => VIRGIL_PUBLIC_KEY_ID));
    echo 'Reading Public Key.' . PHP_EOL;
    $publicKey = file_get_contents('../data/new_public.key');
    echo 'Public Key data successfully readed.' . PHP_EOL;
    echo 'Reading Private Key.' . PHP_EOL;
    $privateKey = file_get_contents('../data/new_private.key');
    echo 'Private Key data successfully readed.' . PHP_EOL;
    // Do service call
    echo 'Call Keys service to delete User Data instance.' . PHP_EOL;
    $keysClient->getUserDataClient()->deleteUserData(VIRGIL_UUID, $privateKey, VIRGIL_PRIVATE_KEY_PASSWORD);
    echo 'User Data instance successfully deleted from Public Keys service.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
require_once '../vendor/autoload.php';
use Virgil\SDK\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_PRIVATE_KEY_PASSWORD = '******';
const VIRGIL_UUID = 'cac16f55-74cf-de0d-1581-d4499f5aa392';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN);
    $keysClient->setHeaders(array('X-VIRGIL-REQUEST-SIGN-PK-ID' => VIRGIL_PUBLIC_KEY_ID));
    echo 'Reading Public Key.' . PHP_EOL;
    $publicKey = file_get_contents('../data/public.key');
    echo 'Public Key data successfully read.' . PHP_EOL;
    echo 'Reading Private Key.' . PHP_EOL;
    $privateKey = file_get_contents('../data/private.key');
    echo 'Private Key data successfully read.' . PHP_EOL;
    // Do service call
    echo 'Call Keys service to resend confirmation.' . PHP_EOL;
    $keysClient->getUserDataClient()->resendConfirmation(VIRGIL_UUID, $privateKey, VIRGIL_PRIVATE_KEY_PASSWORD);
    echo 'Confirmation successfully sent.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
예제 #4
0
 * POSSIBILITY OF SUCH DAMAGE.
 */
require_once '../vendor/autoload.php';
use Virgil\SDK\Keys\Models\UserData, Virgil\SDK\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_USER_DATA_CLASS = 'user_id';
const VIRGIL_USER_DATA_TYPE = 'email';
const VIRGIL_USER_DATA_VALUE = '*****@*****.**';
const VIRGIL_PRIVATE_KEY_PASSWORD = '******';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN, array('base_url' => 'https://keys-stg.virgilsecurity.com'));
    $keysClient->setHeaders(array('X-VIRGIL-REQUEST-SIGN-PK-ID' => VIRGIL_PUBLIC_KEY_ID));
    $userData = new UserData();
    $userData->class = VIRGIL_USER_DATA_CLASS;
    $userData->type = VIRGIL_USER_DATA_TYPE;
    $userData->value = VIRGIL_USER_DATA_VALUE;
    echo 'Reading Public Key.' . PHP_EOL;
    $publicKey = file_get_contents('../data/new_public.key');
    echo 'Public Key data successfully readed.' . PHP_EOL;
    echo 'Reading Private Key.' . PHP_EOL;
    $privateKey = file_get_contents('../data/new_private.key');
    echo 'Private Key data successfully readed.' . PHP_EOL;
    // Do service call
    echo 'Call Keys service to create User Data instance.' . PHP_EOL;
    $userData = $keysClient->getUserDataClient()->createUserData($userData, $privateKey, VIRGIL_PRIVATE_KEY_PASSWORD);
    echo 'User Data instance successfully created in Public Keys service.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}