Move to more PSR-4 standards.
This commit is contained in:
37
lib/OpenPgP/SignaturePacket/KeyFlagsPacket.php
Normal file
37
lib/OpenPgP/SignaturePacket/KeyFlagsPacket.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Leenooks\OpenPGP\SignaturePacket;
|
||||
|
||||
/**
|
||||
* @see http://tools.ietf.org/html/rfc4880#section-5.2.3.21
|
||||
*/
|
||||
class KeyFlagsPacket extends Subpacket
|
||||
{
|
||||
protected $tag = 27;
|
||||
|
||||
function __construct($flags=[])
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->flags = $flags;
|
||||
}
|
||||
|
||||
function body()
|
||||
{
|
||||
$bytes = '';
|
||||
|
||||
foreach($this->flags as $f) {
|
||||
$bytes .= chr($f);
|
||||
}
|
||||
return $bytes;
|
||||
}
|
||||
|
||||
function read()
|
||||
{
|
||||
$this->flags = array();
|
||||
|
||||
while($this->input) {
|
||||
$this->flags[] = ord($this->read_byte());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user