Skip to content

Commit

Permalink
Update license years
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeySeroshtan committed May 1, 2024
1 parent 239de2e commit 1f46d3e
Show file tree
Hide file tree
Showing 65 changed files with 113 additions and 90 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2015-2020, Virgil Security, Inc.
Copyright (c) 2015-2024, Virgil Security, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 5 additions & 3 deletions sample/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down Expand Up @@ -67,10 +67,12 @@

// Result:
var_dump(
$cAlice, $cBob, $messageEncryptedForBob,
$cAlice,
$cBob,
$messageEncryptedForBob,
[
$message => $messageDecryptedForBob,
"isEquals" => $message==$messageDecryptedForBob
"isEquals" => $message == $messageDecryptedForBob
]
);
} catch (\Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion src/Card.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
35 changes: 24 additions & 11 deletions src/CardManager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down Expand Up @@ -206,10 +206,12 @@ public function getCard(string $cardID): Card
$tokenContext = new TokenContext("", 'get');
$token = $this->accessTokenProvider->getToken($tokenContext);

$responseModel = $this->cardClient->getCard($cardID, (string)$token);
$responseModel = $this->cardClient->getCard($cardID, (string) $token);
if ($responseModel instanceof ErrorResponseModel) {
throw new CardClientException(
"error response from card service", $responseModel->getCode(), $responseModel->getMessage()
"error response from card service",
$responseModel->getCode(),
$responseModel->getMessage()
);
}

Expand All @@ -234,10 +236,12 @@ public function searchCards(string $identity): array
$tokenContext = new TokenContext($identity, 'search');
$token = $this->accessTokenProvider->getToken($tokenContext);

$responseModel = $this->cardClient->searchCards($identity, (string)$token);
$responseModel = $this->cardClient->searchCards($identity, (string) $token);
if ($responseModel instanceof ErrorResponseModel) {
throw new CardClientException(
"error response from card service", $responseModel->getCode(), $responseModel->getMessage()
"error response from card service",
$responseModel->getCode(),
$responseModel->getMessage()
);
}

Expand All @@ -263,10 +267,12 @@ public function revokeCard(string $cardID): void
$tokenContext = new TokenContext("", 'revoke');
$token = $this->accessTokenProvider->getToken($tokenContext);

$responseModel = $this->cardClient->revokeCard($cardID, (string)$token);
$responseModel = $this->cardClient->revokeCard($cardID, (string) $token);
if ($responseModel instanceof ErrorResponseModel) {
throw new CardClientException(
"error response from card service", $responseModel->getCode(), $responseModel->getMessage()
"error response from card service",
$responseModel->getCode(),
$responseModel->getMessage()
);
}
}
Expand Down Expand Up @@ -325,7 +331,9 @@ public function exportCardAsRawCard(Card $card): RawSignedModel
$modelSignatures = [];
foreach ($card->getSignatures() as $cardSignature) {
$modelSignatures[] = new RawSignature(
$cardSignature->getSigner(), $cardSignature->getSignature(), $cardSignature->getSnapshot()
$cardSignature->getSigner(),
$cardSignature->getSignature(),
$cardSignature->getSnapshot()
);
}

Expand All @@ -344,10 +352,12 @@ private function publishRawSignedModelWithToken(RawSignedModel $model, AccessTok
$model = $signCallback($model);
}

$responseModel = $this->cardClient->publishCard($model, (string)$token);
$responseModel = $this->cardClient->publishCard($model, (string) $token);
if ($responseModel instanceof ErrorResponseModel) {
throw new CardClientException(
"error response from card service", $responseModel->getCode(), $responseModel->getMessage()
"error response from card service",
$responseModel->getCode(),
$responseModel->getMessage()
);
}

Expand Down Expand Up @@ -376,7 +386,10 @@ private function parseRawCard(RawSignedModel $rawSignedModel, bool $isOutdated =
}

$cardSignatures[] = new CardSignature(
$signature->getSigner(), $signature->getSignature(), $signature->getSnapshot(), $extraFields
$signature->getSigner(),
$signature->getSignature(),
$signature->getSnapshot(),
$extraFields
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/CardParams.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/CardSignature.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/CardClientException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/CardVerificationException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/VirgilException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
8 changes: 4 additions & 4 deletions src/Http/AbstractHttpClient.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down Expand Up @@ -59,11 +59,11 @@ public function send(HttpRequestInterface $httpRequest): HttpResponseInterface
case RequestMethods::HTTP_GET:
return $this->get($httpRequest->getUrl(), [], $httpRequest->getHeaders());
case RequestMethods::HTTP_POST:
return $this->post($httpRequest->getUrl(), (string)$httpRequest->getBody(), $httpRequest->getHeaders());
case RequestMethods::HTTP_DELETE:
return $this->post($httpRequest->getUrl(), (string) $httpRequest->getBody(), $httpRequest->getHeaders());
case RequestMethods::HTTP_DELETE:
return $this->delete(
$httpRequest->getUrl(),
(string)$httpRequest->getBody(),
(string) $httpRequest->getBody(),
$httpRequest->getHeaders()
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Constants/RequestMethods.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Curl/CurlClient.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down Expand Up @@ -143,7 +143,7 @@ protected function doRequest(RequestInterface $httpRequest): HttpResponse
$httpStatusCode = $httpRequest->getInfo(CURLINFO_HTTP_CODE);
$httpRequest->close();

return $this->buildResponse((string)$httpStatusCode, (string)$httpRawResponse);
return $this->buildResponse((string) $httpStatusCode, (string) $httpRawResponse);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Curl/CurlRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Curl/CurlRequestFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Curl/RequestFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Curl/RequestInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/HttpClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/AbstractHttpRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/DeleteHttpRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/GetHttpRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/HttpRequestInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/PostHttpRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Responses/HttpResponse.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Responses/HttpResponseInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Responses/HttpStatusCode.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Responses/HttpStatusCodeInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/VirgilAgent/HttpVirgilAgent.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Signer/ModelSigner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/KeyEntry.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/KeyStorage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/PrivateKeyEntry.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/PrivateKeyStorage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Verification/CardVerifier.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Verification/NullCardVerifier.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2015-2020 Virgil Security Inc.
* Copyright (c) 2015-2024 Virgil Security Inc.
*
* All rights reserved.
*
Expand Down
Loading

0 comments on commit 1f46d3e

Please sign in to comment.