with Ada.Streams; use Ada.Streams;
with GNAT.Strings; use GNAT.Strings;
package Content_Signing is
-- Enable/disable validation of files that don't have known signatures.
procedure Allow_Unsigned_Content( enabled : Boolean );
-- Returns True if a signature for 'filename' is known.
function Is_Signed( filename : String ) return Boolean;
-- Returns True if 'filename' has a known signature and it matches the
-- signature of 'data'.
function Is_Valid( filename : String;
data : Stream_Element_Array ) return Boolean;
-- Calculates the signatures of all files in the 'inFiles' list and writes
-- a signed dictionary to 'filename'. If the dictionary file already
-- exists, it will be overwritten. An exception will be raised on error and
-- the partial dictionary file will be cleaned up.
procedure Make_Dictionary( filename : String;
inFiles : String_List;
authority : String;
progress : access procedure( filename : String;
completion : Natural ) := null );
-- raised by Make_Dictionary when a file operation fails
File_Error : exception;
private
DICTIONARY_FILENAME : constant String := "files.digest";
end Content_Signing;