In a gateway device for carrying out a data relaying at a transport or
upper layer between a first terminal device and a second terminal device
which are capable of carrying out communications through networks,
information regarding a security association set up between the first
terminal device and the second terminal device in order to carry out
communications with guaranteed data secrecy or in order to carry out
communications with guaranteed data authenticity managed, and the
decryption/encryption processing or the authentication processing is
carried out according to the managed information regarding the security
association along with the data relaying at the transport or upper layer.