Skip to content

Load multiple certificates from one PEM file #462

@xionglingfeng

Description

@xionglingfeng

I am playing pyOpenSSL with a multi-level PKI. My purpose is to generate and sign a CSR with a L2 CA, and output the sgined certificate chain.

Files I have:

ca.key : Private key for L2 CA
ca.crt : Certificate chain for L2 CA

I load L2 CA certificate by

with open('ca.crt', 'r') as f:
    cacrt = crypto.load_certificate(crypto.FILETYPE_PEM, f.read())

But cacrt contains only one certificate (L2 CA certificate), the certificate of Root CA is missing. Is there anyway to get it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions