_bool; } protected function encodedAsDER(): string { return $this->_bool ? chr(0xff) : chr(0); } protected static function decodeFromDER(Identifier $identifier, string $data, int &$offset): ElementBase { $idx = $offset; Length::expectFromDER($data, $idx, 1); $byte = ord($data[$idx++]); if ($byte !== 0) { if ($byte !== 0xff) { throw new DecodeException('DER encoded boolean true must have all bits set to 1.'); } } $offset = $idx; return self::create($byte !== 0); } }