v2025/src/PSSailpoint.V2025/Model/JWK.ps1

#
# Identity Security Cloud V2025 API
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.
# Version: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

A single JSON Web Key used for verifying signed delivery requests.

.PARAMETER Alg
Algorithm intended for use with the key (e.g. RS256).
.PARAMETER E
RSA public exponent (Base64url encoded).
.PARAMETER Kid
Key ID - unique identifier for the key.
.PARAMETER Kty
Key type (e.g. RSA).
.PARAMETER N
RSA modulus (Base64url encoded).
.PARAMETER Use
Intended use of the key (e.g. sig for signature verification).
.OUTPUTS

JWK<PSCustomObject>
#>


function Initialize-V2025JWK {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Alg},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${E},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Kid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Kty},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${N},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Use}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint.V2025 => V2025JWK' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "alg" = ${Alg}
            "e" = ${E}
            "kid" = ${Kid}
            "kty" = ${Kty}
            "n" = ${N}
            "use" = ${Use}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to JWK<PSCustomObject>

.DESCRIPTION

Convert from JSON to JWK<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

JWK<PSCustomObject>
#>

function ConvertFrom-V2025JsonToJWK {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint.V2025 => V2025JWK' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025JWK
        $AllProperties = ("alg", "e", "kid", "kty", "n", "use")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "alg"))) { #optional property not found
            $Alg = $null
        } else {
            $Alg = $JsonParameters.PSobject.Properties["alg"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "e"))) { #optional property not found
            $E = $null
        } else {
            $E = $JsonParameters.PSobject.Properties["e"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "kid"))) { #optional property not found
            $Kid = $null
        } else {
            $Kid = $JsonParameters.PSobject.Properties["kid"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "kty"))) { #optional property not found
            $Kty = $null
        } else {
            $Kty = $JsonParameters.PSobject.Properties["kty"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "n"))) { #optional property not found
            $N = $null
        } else {
            $N = $JsonParameters.PSobject.Properties["n"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "use"))) { #optional property not found
            $Use = $null
        } else {
            $Use = $JsonParameters.PSobject.Properties["use"].value
        }

        $PSO = [PSCustomObject]@{
            "alg" = ${Alg}
            "e" = ${E}
            "kid" = ${Kid}
            "kty" = ${Kty}
            "n" = ${N}
            "use" = ${Use}
        }

        return $PSO
    }

}