Created
June 13, 2018 21:49
-
-
Save R41D3NN/f2b9206311208fd7a5a0217dbbb0749e to your computer and use it in GitHub Desktop.
Get Public Key From SNK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kudos Ivan G.: https://stackoverflow.com/a/43897217 | |
function Get-SnkPublicKey([string]$FilePath) | |
{ | |
$bytes = [System.IO.File]::ReadAllBytes($FilePath) | |
$pair = New-Object System.Reflection.StrongNameKeyPair -ArgumentList @(,$bytes) | |
$publicKey = $pair.PublicKey | |
#[System.Convert]::ToBase64String($publicKey) | |
$hexes = [System.BitConverter]::ToString($publicKey); | |
$hexes.Replace("-", "") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment