-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nguyen Van Nguyen <nguyennv1981@gmail.com>
- Loading branch information
Showing
7 changed files
with
85 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the PHP Privacy project. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace OpenPGP\Enum; | ||
|
||
/** | ||
* Key version enum | ||
* | ||
* @package OpenPGP | ||
* @category Enum | ||
* @author Nguyen Van Nguyen - nguyennv1981@gmail.com | ||
*/ | ||
enum KeyVersion: int | ||
{ | ||
case V4 = 4; | ||
case V6 = 6; | ||
|
||
/** | ||
* Get hash algo name | ||
* | ||
* @return string | ||
*/ | ||
public function hashAlgo(): string | ||
{ | ||
return match ($this) { | ||
self::V4 => 'sha1', | ||
self::V6 => 'sha256', | ||
}; | ||
} | ||
} |
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
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
Oops, something went wrong.