Skip to content

Error: (1, 'cannot read key') #342

Open
@danielmendez14

Description

@danielmendez14

Hi! I have a problem, when I do this:

key = xmlsec.Key.from_file(p12_path, xmlsec.constants.KeyDataFormatPkcs12, password=pass)

The file .p12 I can extract the private key and certificate whit this:

private_key, certificate, additional_certs = pkcs12.load_key_and_certificates(p12_data, clave.encode("utf-8"))
print("🔐 Private key:", private_key)

And then it print: <cryptography.hazmat.bindings._rust.openssl.rsa.RSAPrivateKey object at 0x73e07a4763d0>

Then, the path is fine, and the file also. What do I am doing wrong? Help, thanks

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