Skip to content

parsePkcs12 generating an incorrect private key #110

@pedroserretti

Description

@pedroserretti

Hi!
I'm doing a function to sign my XML's by my .pfx file, so i need to parsePkcs12 to get private key.

I've already tested with one certificate and it does successfully, but when i tested with another certificate, my XML wasn't signing anymore.

So i generated a PEM file from my PFX file to compare. When i analyzed, i realized that my PEM generated from parsePkcs12 was different of my PEM file.

Here's an example of what's coming for me:

Initials from my PEM file:

-----BEGIN PRIVATE KEY-----
MIIEvQIBADAN... (omitted)

... WiCjgGs9A= (omitted)
-----END PRIVATE KEY-----

Initials from PEM generated by parsePkcs12:

-----BEGIN PRIVATE KEY-----
MIIEzAIBADANBgkqh... (omitted)

...8xBAMCABA= (omitted)
-----END PRIVATE KEY-----

Can anyone help me please??
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions