Can any asterisk sip trunk register to another Asterisk server?

Actually i wanted to simulate this scenario with 2 asterisk servers. My destination installation is like this

508 is a IP phone which does not support neither TLS nor SRTP. And 508 will register to Asterisk server.
I want asterisk to converts 508’s SIP signals to TLS and media stream to SRTP. 508 IP phone will conversate with another TLS supported IP phone.

502 is a sip client which supports TLS and SRTP. So there is not any problem in 502 sip client.
Asterisk can do it? Asterisk can change none TLS signals to TLS and none RTP media to SRTP?