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

AdfsRelyingPartyTrust: Add Support for EncryptionCertificate and RequestSigningCertificate #5

Open
X-Guardian opened this issue Oct 24, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@X-Guardian
Copy link
Owner

X-Guardian commented Oct 24, 2019

The AdfsRelyingPartyTrust resource needs to support an Encryption Certificate and Request Signing Certificates.

New resource properties required:

Property Name Type Description
EncryptionCertificate String Specifies the certificate to be used for encrypting claims that are issued to this relying party. This should be in Base64 CER encoded format.
RequestSigningCertificate String Array Specifies an array of certificates to be used to verify the signature on a request from the relying party. This should be in Base64 CER encoded format.

The AdfsRelyingPartyTrust cmdlets expect to be passed values of type System.Security.Cryptography.X509Certificates.X509Certificate2 for these parameters.

The following code can be used to create an X509Certificate2 object from the Base64 CER data:

$certCerAsciiData = '<CertCERData>'
$certCerByteData = [System.Text.Encoding]::UTF8.GetBytes($certCerAsciiData)
$x509Certificate2 = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($certCerByteData)

The following code can be used to extract Base64 CER data from an x509Certificate2 object:

$certCerAsciiData = @(
    '-----BEGIN CERTIFICATE-----'
    [System.Convert]::ToBase64String($x509Certificate2.RawData, 'InsertLineBreaks')
    '-----END CERTIFICATE-----'
) | Out-String
@X-Guardian X-Guardian added the enhancement New feature or request label Nov 10, 2019
@DanielHabenicht
Copy link

DanielHabenicht commented Sep 27, 2023

Are you open for a PR regarding this issue?

I would use X509 Certificate object as parameter instead.

@X-Guardian
Copy link
Owner Author

Yes sure @DanielHabenicht, I'm not sure that you can get the CER data from the x509Certificate object, but I'm happy to review a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants