PEMEncrypt
PEMEncrypt copied to clipboard
Exception calling the Encrypt function
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.
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?
Replicating this everywhere myself, unexpectedly, since this hasn't really changed in a while. Working on troubleshooting, thanks for the report!