User bio
404 bio not found
Member since Oct 15, 2018
Posts:
Replies:
def verify_chain(signer_cert, ca_bundle_path):
"""Verify that the signer certificate chains up to a trusted CA in the bundle."""
# Load trusted CAs
ca_store = crypto.X509Store()
with open(ca_bundle_path, "rb") as f:
pem_data = f.read()
# Split bundle into individual certs
for chunk in pem_data.split(b"-----END CERTIFICATE-----"):
block = chunk.strip()
if not block:
continue
block += b"\n-----END CERTIFICATE-----\n"
try:
ca = crypto.load_certificate(crypto.FILETYPE_PEM, block)
ca_store.add_cert(ca)
except Exception:
# Skip things that aren't PEMs
continue
# Convert cryptography.x509.Certificate -> OpenSSL.crypto.X509
signer_pem = signer_cert.public_bytes(encoding=serialization.Encoding.PEM)
signer_x509 = crypto.load_certificate(crypto.FILETYPE_PEM, signer_pem)
# Now verify
store_ctx = crypto.X509StoreContext(ca_store, signer_x509)
try:
store_ctx.verify_certificate()
print("✔ Certificate chain validation passed.")
except Exception as e:
raise ValueError(f"Certificate chain validation failed: {e}")
I was able to use the LoadCertificate() method. I am working on converting python code to ObjectScript.
Open Exchange applications:
Certifications & Credly badges:
Oliver has no Certifications & Credly badges yet.
Global Masters badges:







Followers:
Following:
Can you copy the file from Backup to Primary server?