< Back

ConvertFrom-DSAPublicKeyPEM

Sat Jan 11, 2020 12:38 pm

NAME ConvertFrom-DSAPublicKeyPEM



SYNOPSIS

Converts a PEM file to an DSACryptoServiceProvider object.





SYNTAX

ConvertFrom-DSAPublicKeyPEM [-PEM] <String> [<CommonParameters>]



ConvertFrom-DSAPublicKeyPEM -Path <String> [<CommonParameters>]





DESCRIPTION

This cmdlet takes a DSA Public Key PEM file and converts it to

a DSACryptoServiceProvider object.





PARAMETERS

-PEM <String>

The PEM content of the DSA Public Key. This can either be the complete PEM file contents

or just the base64 encoded data.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Path <String>

The path to a properly encoded PEM file with the appropriate Header and Footer text.



The file can only contain a single key, subsequent keys in the same file will be ignored.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String





OUTPUTS

System.Security.Cryptography.DSACryptoServiceProvider





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 1/26/2018



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$Key = @"



-----BEGIN DSA PUBLIC KEY-----

<base64encodedkeydata>

-----END DSA PUBLIC KEY-----

"@



$RSA = ConvertFrom-DSAPrivateKeyPEM -PEM $Key



This will convert the PEM file containing a public key to an DSACryptoServiceProvider object.











RELATED LINKS