Skip to content

Refactor the inefficient function to parse PKCS#8 encrypted private keys #29

Description

@akkahshh24

Description

Currently, the function to parse the encrypted private key invokes the openssl command, writes temporary files, and reads back the decrypted output. While this works, it's very inefficient.

espresso/lib/certmanager/certmanager.go:122

// Helper function to parse PKCS#8 encrypted private keys
func parseEncryptedPKCS8PrivateKey(data, password []byte) (interface{}, error)

Go's x509 and pem standard libraries already provide support for decrypting encrypted PEM blocks using x509.DecryptPEMBlock.

Benefits

  1. No call to external dependencies like openssl
  2. No writing to and reading from temp files.

I'd be happy to work on this and create a pull request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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