How can I implement an interface in StarBasic?

I’m now trying to call the following method, but I don’t quite understand how to implement XCurrentContext and XAuthenticator with pure StarBasic. Can someone tell me how to?

https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1mail_1_1XMailService.html#ab79b8c3704819a256a2072b255c9b709