* 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\Models\UserData, Virgil\SDK\Keys\Models\UserDataCollection, 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 = '******';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN);
    $userData = new UserData();
    $userData->class = VIRGIL_USER_DATA_CLASS;
    $userData->type = VIRGIL_USER_DATA_TYPE;
    $userData->value = VIRGIL_USER_DATA_VALUE;
    $userDataCollection = new UserDataCollection();
    $userDataCollection->add($userData);
    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 create Public Key instance.' . PHP_EOL;
    $publicKey = $keysClient->getPublicKeysClient()->createKey($publicKey, $userDataCollection, $privateKey, VIRGIL_PRIVATE_KEY_PASSWORD);
 *     (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();
}
 * 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_USER_DATA_VALUE = '*****@*****.**';
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 'Read Private Key.' . PHP_EOL;
    $privateKey = file_get_contents('../data' . DIRECTORY_SEPARATOR . 'private.key');
    echo 'Private Key is:' . PHP_EOL;
    echo $privateKey . PHP_EOL;
    $privateKeyPassword = '******';
    // Do service call
    echo 'Call Keys service to search Public Key instance.' . PHP_EOL;
    $result = $keysClient->getPublicKeysClient()->grabKey(VIRGIL_USER_DATA_VALUE, $privateKey, $privateKeyPassword);
    echo 'Public Key instance successfully searched in Keys service.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
 *
 *     (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\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_USER_DATA_VALUE = '*****@*****.**';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN);
    // Do service call
    echo 'Call Keys service to search Public Key instance.' . PHP_EOL;
    $result = $keysClient->getPublicKeysClient()->grabKey(VIRGIL_USER_DATA_VALUE);
    echo 'Public Key instance successfully searched in Keys service.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
 *     (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\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
const VIRGIL_ACTION_TOKEN = '31b4be12-9021-76bc-246d-5ecbd7a22350';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN);
    // Do service call
    echo 'Call Keys service to persist Public Key instance.' . PHP_EOL;
    $publicKey = $keysClient->getPublicKeysClient()->persistKey(VIRGIL_PUBLIC_KEY_ID, VIRGIL_ACTION_TOKEN, array('Y4A6D9'));
    echo 'Public Key instance successfully persisted.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
예제 #6
0
 * 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\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
const VIRGIL_PRIVATE_KEY_PASSWORD = '******';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN, array('base_url' => 'https://keys-stg.virgilsecurity.com'));
    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 reset Public Key instance.' . PHP_EOL;
    $result = $keysClient->getPublicKeysClient()->resetKey(VIRGIL_PUBLIC_KEY_ID, $publicKey, $privateKey, VIRGIL_PRIVATE_KEY_PASSWORD);
    echo 'Public Key instance successfully resetted.' . 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();
}
예제 #8
0
 * 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\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
const VIRGIL_PRIVATE_KEY_PASSWORD = '******';
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 update Public Key instance.' . PHP_EOL;
    $publicKey = $keysClient->getPublicKeysClient()->updateKey(VIRGIL_PUBLIC_KEY_ID, $publicKey, $privateKey, VIRGIL_PRIVATE_KEY_PASSWORD);
    echo 'Public Key instance successfully updated in Public Keys service.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
 *
 *     (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\Keys\Client as KeysClient;
const VIRGIL_APPLICATION_TOKEN = '17da4b6d03fad06954b5dccd82439b10';
const VIRGIL_PUBLIC_KEY_ID = '5d3a8909-5fe5-2abb-232c-3cf9c277b111';
try {
    // Create Keys Service HTTP Client
    $keysClient = new KeysClient(VIRGIL_APPLICATION_TOKEN);
    // Do service call
    echo 'Call Keys service to get Public Key instance.' . PHP_EOL;
    $publicKey = $keysClient->getPublicKeysClient()->getKey(VIRGIL_PUBLIC_KEY_ID);
    echo 'Public Key instance successfully returned Public Keys instance.' . PHP_EOL;
} catch (Exception $e) {
    echo 'Error:' . $e->getMessage();
}
예제 #10
0
 * 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\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;