'Extracting root and intermediate certificates from .cer file MAC

My question might look very similar to this one:

How to get CA Root and Intermdiate certificates from .cer file

I need to extract inter and root certificates from .cer file, I can do this on windows, but I do not understand why it's not possible to do it on mac without googling and going into issuers website, etc...

Would it be possible to somehow setup mac so I would be able to simply extract inter and root certificates just like on Windows machine?

I would not mind using Java / Python / whatever required for that.

I did read quite a bit of posts in here but didn't find proper answer, so sorry if this is a duplicate.

Regards.

EDIT:

Below is an example of how you can extract inter / root certificate in windows machine.

Windows keytool Windows keytool2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source