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

Getting signature algorithm of signed certificates #37

Closed
Yves10001 opened this issue May 9, 2018 · 2 comments
Closed

Getting signature algorithm of signed certificates #37

Yves10001 opened this issue May 9, 2018 · 2 comments
Labels
question This is a general question.

Comments

@Yves10001
Copy link

I'm trying to get the signature algorithm of signed certificates. The goal is to get a list of certificates that have been signed with sha1 before the sha256 migration of your PKI.

using Get-IssuedRequest -Property * I'm not able to get the signature algorithm

is there another way to get the signature algorithm? or I am doing something wrong?

thanks

@Crypt32 Crypt32 added the question This is a general question. label May 9, 2018
@Crypt32
Copy link
Collaborator

Crypt32 commented May 9, 2018

You can try this way:

Get-IssuedRequest -ca $ca -Property "RawCertificate" | %{
    $bytes = [convert]::FromBase64String($_.Properties["RawCertificate"])
    $cert = new-object security.cryptography.x509certificates.x509certificate2 (,$bytes)
    Write-Host "$request: $($_.RowID), algorithm: $($cert.SignatureAlgorithm)"
}

@Yves10001
Copy link
Author

Yves10001 commented May 9, 2018

thanks a lot for your instructions, i had to do a little tweak but now it's working like that:
Get-IssuedRequest -ca $ca -Property "RawCertificate" | %{ $bytes = [convert]::FromBase64String($_.Properties["RawCertificate"]) $cert = new-object security.cryptography.x509certificates.x509certificate2 (,$bytes) Write-Host "$request $($_.RowID), algorithm: $($cert.SignatureAlgorithm.FriendlyName)" }

@Crypt32 Crypt32 closed this as completed Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a general question.
Projects
None yet
Development

No branches or pull requests

2 participants