Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception calling the Encrypt function #6

Open
mosesmosheh opened this issue Feb 24, 2021 · 2 comments
Open

Exception calling the Encrypt function #6

mosesmosheh opened this issue Feb 24, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mosesmosheh
Copy link

When executing your command:
$encrypted = "Hello","How are you" | Protect-PEMString -PublicKey .\mykey.pub
PowerShell throws the Exception Error

Protect-PEMString : Exception calling "Encrypt" with "2" argument(s): "Object reference not set to an instance of an
object."
At line:1 char:38
+ ... Hello","How are you" | Protect-PEMString -PublicKey .\mykey.pub
+                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Protect-PEMString], MethodInvocationException
    + FullyQualifiedErrorId : NullReferenceException,Protect-PEMString

I am using PowerShell Version 5.1.17763.1490 and version 0.2.1 of the PEMEncrypt module.

@scrthq
Copy link
Member

scrthq commented Feb 26, 2021

heya @mosesmosheh - can you try explicitly importing the module before running that command? Also, assuming that public key you're trying to use exists at that path, is that public key an RSA key or another protocol?

@scrthq scrthq self-assigned this Feb 26, 2021
@scrthq
Copy link
Member

scrthq commented Feb 26, 2021

Replicating this everywhere myself, unexpectedly, since this hasn't really changed in a while. Working on troubleshooting, thanks for the report!

@scrthq scrthq added the bug Something isn't working label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants