IRISLIB database
JWKS Class Reference

This class provides methods to create and manage JSON Web Key Sets, as defined in RFC 7517. More...

Inheritance diagram for JWKS:
Collaboration diagram for JWKS:

Static Public Member Functions

_.Library.Status GetJWK (_.Library.String alg, _.Library.String kid, _.Library.String JWKS, _.Library.DynamicObject JWK)
 This class provides methods to create and manage JSON Web Key Sets, as defined in RFC 7517. More...
 
_.Library.Status InitializeJWKS (_.Library.String JWKS)
 This method creates a new JSON Web Key Set (JWKS). More...
 
_.Library.Status PutJWK (_.Library.DynamicObject JWK, _.Library.String JWKS)
 This methods adds a JSON Web Key (JWK) to a JSON Web Key Set (JWKS). More...
 
_.Library.Status RemoveJWK (_.Library.String alg, _.Library.String kid, _.Library.String JWKS)
 This method removes JSON Web Keys (JWK) that match the provided algorithm and/or key ID from a JSON Web Key Set (JWKS). More...
 

Additional Inherited Members

- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

This class provides methods to create and manage JSON Web Key Sets, as defined in RFC 7517.

Member Function Documentation

◆ GetJWK()

This class provides methods to create and manage JSON Web Key Sets, as defined in RFC 7517.

This method returns a JSON Web Key (JWK) that matches the provided algorithm and/or key ID from the given JSON Web Key Set (JWKS).



Input parameters:

  • alg - The algorithm of the desired JWK.
  • kid - The key ID of the desired JWK.
  • JWKS - The JWKS to search for the desired key.


Output parameters:

  • JWK - The JWK that matches the provided algorithm and/or key ID.


Return value:

  • A status indicating whether or not the method was able to use the provided inputs to search the given JWKS, where error values indicate that it was unable to search and describe the reason why.


Notes:

  • This method uses the following criteria, listed in order of priority, to determine which key to return:
    1. alg/kid combination exact match
    2. alg (but not kid) match
    3. kid match and the key is for an algorithm with the same key type as alg
    4. kid match
  • If more than one key is found for a given criterium, then the last key that meets that criterium is returned.
  • This method will return an error if it finds a key in the JWKS that is not a valid JWK.
  • This method will succeed if no key is found for the given alg/kid, but the JWK output value will be emtpy.

◆ InitializeJWKS()

_.Library.Status InitializeJWKS ( _.Library.String  JWKS)
static

This method creates a new JSON Web Key Set (JWKS).



Output parameters:


Return value:

  • A status value indicating whether or not the JWKS was created, where errors indicate that it wasn't created and describe why.


Notes:

  • This simply creates an empty JWKS.

◆ PutJWK()

_.Library.Status PutJWK ( _.Library.DynamicObject  JWK,
_.Library.String  JWKS 
)
static

This methods adds a JSON Web Key (JWK) to a JSON Web Key Set (JWKS).



Input parameters:


Return value:

  • A status indicating whether or not the provided JWK was added to the JWKS, where error values indicate that it was not added and describe the reason why.


Notes:

  • If JWKS is null, then a new JWKS will be created and the key will be added to it.
  • This method does not add a kid to keys when it puts them in the JWKS. In order to use kids, they must be added before the key is added to the JWKS. For example:
        Set JWK.kid=1
        Do ##class(Net.JSON.JWKS).PutJWK(JWK,.JWKS)

◆ RemoveJWK()

_.Library.Status RemoveJWK ( _.Library.String  alg,
_.Library.String  kid,
_.Library.String  JWKS 
)
static

This method removes JSON Web Keys (JWK) that match the provided algorithm and/or key ID from a JSON Web Key Set (JWKS).



Input parameters:

  • alg - The algorithm of the JWKs that are to be removed from the JWKS.
  • kid - The key ID of the JWKs that are to be removed from the JWKS.
  • JWKS - The JWKS to remove keys from.


Return value:

  • A status indicating whether or not the method was able to use the provided inputs to search the given JWKS to attempt to remove keys, where error values indicate that it was unable to search and describe the reason why.


Notes:

  • If both alg and kid are defined, this method will remove only those keys that match both alg and kid.
  • If only alg is defined, this method will remove all keys for that algorithm.
  • If only kid is defined, this method will remove all keys with that key ID.