1. with Ada.Streams;                       use Ada.Streams; 
  2. with GNAT.Strings;                      use GNAT.Strings; 
  3.  
  4. package Content_Signing is 
  5.  
  6.     -- Enable/disable validation of files that don't have known signatures. 
  7.     procedure Allow_Unsigned_Content( enabled : Boolean ); 
  8.  
  9.     -- Returns True if a signature for 'filename' is known. 
  10.     function Is_Signed( filename : String ) return Boolean; 
  11.  
  12.     -- Returns True if 'filename' has a known signature and it matches the 
  13.     -- signature of 'data'. 
  14.     function Is_Valid( filename : String; 
  15.                        data     : Stream_Element_Array ) return Boolean; 
  16.  
  17.     -- Calculates the signatures of all files in the 'inFiles' list and writes 
  18.     -- a signed dictionary to 'filename'. If the dictionary file already 
  19.     -- exists, it will be overwritten. An exception will be raised on error and 
  20.     -- the partial dictionary file will be cleaned up. 
  21.     procedure Make_Dictionary( filename  : String; 
  22.                                inFiles   : String_List; 
  23.                                authority : String; 
  24.                                progress  : access procedure( filename   : String; 
  25.                                                              completion : Natural ) := null ); 
  26.  
  27.     -- raised by Make_Dictionary when a file operation fails 
  28.     File_Error : exception; 
  29.  
  30. private 
  31.  
  32.     DICTIONARY_FILENAME : constant String := "files.digest"; 
  33.  
  34. end Content_Signing;