openpgp-php/lib/OpenPgP/SignaturePacket/PreferredHashAlgorithmsPacket.php

29 lines
452 B
PHP
Raw Permalink Normal View History

2020-06-07 06:25:59 +00:00
<?php
namespace Leenooks\OpenPGP\SignaturePacket;
/**
* @see http://tools.ietf.org/html/rfc4880#section-5.2.3.8
*/
class PreferredHashAlgorithmsPacket extends Subpacket
{
protected $tag = 21;
function body()
{
$bytes = '';
foreach($this->data as $algo) {
$bytes .= chr($algo);
}
return $bytes;
}
function read()
{
$this->data = array();
while(strlen($this->input) > 0) {
$this->data[] = ord($this->read_byte());
}
}
}