jwtPS.dll-Help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>ConvertFrom-Jwt</command:name> <command:verb>ConvertFrom</command:verb> <command:noun>Jwt</command:noun> <maml:description> <maml:para>This function accepts a string in the format of a Json Web Token (JWT) and returns a hashtable with of the header and claimset converted from Base 64.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The string must be a valid JWT. The function will split the string into the three parts of a JWT and convert the first two parts back into the human-readable format. The header and the claimset will be returned as a hashtable.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>ConvertFrom-Jwt</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Jwt</maml:name> <maml:description> <maml:para>Expects string in valid JWT format.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Jwt</maml:name> <maml:description> <maml:para>Expects string in valid JWT format.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> ConvertFrom-Jwt -Jwt "eyJ0eXAi[...]I1NiJ9.eyJpYXQiOjEyMzQ1Njc[...]IsImV4cCI6OTg3NjU0MzIxfQ.K741[...]Yf2aE68CHY"</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-Jwt</command:name> <command:verb>New</command:verb> <command:noun>Jwt</command:noun> <maml:description> <maml:para>The function creates a Json Web Token (JWT).</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Three parts are required to create a JWT: the algorithm which decides how the body of the JWT will be encrypted, the claimset which carries the message and the secret (Password for HMAC encryption or private key for RSA or ECDsa). The private keys must be in PEM format.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-Jwt</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Algorithm</maml:name> <maml:description> <maml:para>Set the encryption algorithm.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Algorithm</command:parameterValue> <dev:type> <maml:name>Algorithm</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Payload</maml:name> <maml:description> <maml:para>Provide the claimset.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Secret</maml:name> <maml:description> <maml:para>The secret is a password for HMAC encryption and a private key for RSA or ECDsa algorithms.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Algorithm</maml:name> <maml:description> <maml:para>Set the encryption algorithm.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Algorithm</command:parameterValue> <dev:type> <maml:name>Algorithm</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Payload</maml:name> <maml:description> <maml:para>Provide the claimset.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Secret</maml:name> <maml:description> <maml:para>The secret is a password for HMAC encryption and a private key for RSA or ECDsa algorithms.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> New-Jwt -Payload @{'iat'=123456789} -Algorithm [jwtFunction+Algorithm+HMAC]::NewHMAC([jwtFunction+hsAlgorithm]::HS256) -Secret P@ssw0rd</dev:code> <dev:remarks> <maml:para>This function returns a JWT with HMAC encryption.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> New-Jwt -Payload @{'iat'=123456789} -Algorithm [jwtFunction+Algorithm+RSA]::NewRSA([jwtFunction+rsAlgorithm]::RS386) -Secret Path\To\File.pem</dev:code> <dev:remarks> <maml:para>This function returns a JWT with RSA encryption and SHA386.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>PS C:\> New-Jwt -Payload @{'iat'=123456789} -Algorithm [jwtFunction+Algorithm+ECDsa]::NewECDsa([jwtFunction+esAlgorithm]::RS512) -Secret Path\To\File.pem</dev:code> <dev:remarks> <maml:para>This function returns a JWT with ECDsa encryption and SHA512.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> </helpItems> |