[python] M2Crypto를 사용하여 X.509 인증서 서명자의 인증서를 확인하는 방법은 어떻게 되나요?

이를 위해 먼저 M2Crypto를 설치해야합니다. 아래는 M2Crypto를 사용하여 X.509 인증서의 서명자를 확인 및 발급자의 인증서를 가져오는 예제 코드입니다.

먼저 M2Crypto를 설치하고, 인증서 파일을 읽어들인 후 아래 코드를 실행하여 인증서의 서명자를 확인하고 발급자의 인증서를 가져올 수 있습니다.

from M2Crypto import X509

# Load the certificate
cert_file = 'path_to_your_certificate.pem'
cert = X509.load_cert(cert_file)

# Get the issuer's certificate
issuer_cert = cert.get_issuer()

# Print the issuer's certificate
print(issuer_cert.as_text())

위의 코드를 사용하여 서명자의 인증서를 확인하고 발급자의 인증서를 가져올 수 있습니다.