When I use this code:
$rawBytes = [convert]::frombase64string($RawRequest)
$pkcs7 = new-object System.Security.Cryptography.Pkcs.PKCS7SignedMessage(,$rawBytes)
# get embedded request:
$pkcs7.Content[0]
# get SAN extension:
$pkcs7.Content[0].Extensions | ?{$_.oid.value -eq "2.5.29.17"}
I am still getting: Exception calling ".ctor" with "1" argument(s): "ASN1 bad tag value met"