/* * Copyright (c) 2022, Julian Offenhäuser * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace PDF { class Reader; class Encoding; class PS1FontProgram : public Type1FontProgram { public: static PDFErrorOr> create(ReadonlyBytes const&, RefPtr, size_t cleartext_length, size_t encrypted_length); private: PDFErrorOr parse_encrypted_portion(ByteBuffer const&); PDFErrorOr> parse_subroutines(Reader&) const; static PDFErrorOr> parse_number_array(Reader&, size_t length); static PDFErrorOr parse_word(Reader&); static PDFErrorOr parse_float(Reader&); static PDFErrorOr parse_int(Reader&); static PDFErrorOr decrypt(ReadonlyBytes const&, u16 key, size_t skip); static bool seek_name(Reader&, DeprecatedString const&); u16 m_encryption_key { 4330 }; int m_lenIV { 4 }; }; }