-- reading a RSA key pair from a file -- NB: this is for TESTING purposes only, NOT a production IO package! -- S.MG, 2018 with Raw_Types; with RSA_OAEP; package IO_RSA is -- reads a full private key from specified file, in Hex format -- one component per line, in order: n, e, d, p, q, u -- NB: length of each component has to match *precisely* the expected length -- specifically, using Raw_Types: -- n, d are RSA_len'Length*2; -- e, p, q, u are RSA_half'Length*2 procedure ReadRSAKey( Filename: in String; Key: out RSA_OAEP.RSA_skey ); -- convert hexadecimal strings to octets representation procedure Hex2Octets( Hex: in String; O: out Raw_Types.Octets ); end IO_RSA;