-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19236 from totten/master-crypt-svc
dev/core#2258 - Add services to support encryption
- Loading branch information
Showing
12 changed files
with
1,082 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/* | ||
+--------------------------------------------------------------------+ | ||
| Copyright CiviCRM LLC. All rights reserved. | | ||
| | | ||
| This work is published under the GNU AGPLv3 license with some | | ||
| permitted exceptions and without any warranty. For full license | | ||
| and copyright information, see https://civicrm.org/licensing | | ||
+--------------------------------------------------------------------+ | ||
*/ | ||
namespace Civi\Crypto; | ||
|
||
/** | ||
* @package Civi\Crypt | ||
*/ | ||
interface CipherSuiteInterface { | ||
|
||
/** | ||
* Get a list of supported cipher suites. | ||
* | ||
* @return array | ||
* Ex: ['aes-cbc', 'aes-bbc', 'aes-pbs'] | ||
*/ | ||
public function getSuites(): array; | ||
|
||
/** | ||
* Encrypt a string | ||
* | ||
* @param string $plainText | ||
* @param array $key | ||
* | ||
* @return string | ||
* Encrypted content as a binary string. | ||
* Depending on the suite, this may include related values (eg HMAC + IV). | ||
*/ | ||
public function encrypt(string $plainText, array $key): string; | ||
|
||
/** | ||
* Decrypt a string | ||
* | ||
* @param string $cipherText | ||
* Encrypted content as a binary string. | ||
* Depending on the suite, this may include related values (eg HMAC + IV). | ||
* @param array $key | ||
* | ||
* @return string | ||
* Decrypted string | ||
*/ | ||
public function decrypt(string $cipherText, array $key): string; | ||
|
||
} |
Oops, something went wrong.