This class provides methods to create JSON Web Keys, as defined in RFC 7517, and convert between the JSON Web Key format and other key representation formats. More...
Static Public Member Functions | |
_.Library.Status | Create (_.Library.String alg, _.Library.String secret, _.Library.DynamicObject privJWK, _.Library.DynamicObject pubJWK) |
This class provides methods to create JSON Web Keys, as defined in RFC 7517, and convert between the JSON Web Key format and other key representation formats. More... | |
_.Library.Status | CreateX509 (_.Library.String alg, _.SYS.X509Credentials x509, _.Library.DynamicObject privJWK, _.Library.DynamicObject pubJWK) |
This method creates a new JSON Web Key (JWK) pair for the given algorithm based on the RSA key(s) contained in the given <class>SYS.X509Credentials</class> object. More... | |
_.Library.Status | JWKtoASN1 (_.Library.DynamicObject JWK, _.Library.String ASN1) |
This method converts a key in JSON Web Key (JWK) format to PEM-encoded DER ASN.1 format. More... | |
Additional Inherited Members | |
![]() | |
_.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... | |
![]() | |
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... | |
This class provides methods to create JSON Web Keys, as defined in RFC 7517, and convert between the JSON Web Key format and other key representation formats.
|
static |
This class provides methods to create JSON Web Keys, as defined in RFC 7517, and convert between the JSON Web Key format and other key representation formats.
This method creates a new public/private JSON Web Key (JWK) pair for the given algorithm.
Input parameters:
Output parameters:
Return value:
Notes:
Set sc=##class(Net.JSON.JWK).Create("ES256",,.privJWK,.pubJWK) If $$$ISOK(sc) { Set privJWK.kid=1 Set pubJWK.kid=1 }
Set sc=##class(Net.JSON.JWK).Create("ES256",,.privJWK,.pubJWK) If $$$ISOK(sc) { Set privJWK=privJWK.ToJSON() Set pubJWK=pubJWK.ToJSON() Do ##class(Net.JSON.JWE).Encrypt({"alg":"RSA1_5","enc":"A256CBC-HS512"},,,privJWK,,,JWKS,.encryptedPrivJWK) Do ##class(Net.JSON.JWE).Encrypt({"alg":"RSA1_5","enc":"A256CBC-HS512"},,,pubJWK,,,JWKS,.encryptedPubJWK) }<br<blockquote>
Where JWKS is a JWKS that contains a key for RSA1_5. This method will return an error if an unrecognized algorithm is used. Assuming creation was successful, privJWK will always have a non-null value. If the algorithm is symmetric, then pubJWK will be null even if creation succeeded.
|
static |
This method creates a new JSON Web Key (JWK) pair for the given algorithm based on the RSA key(s) contained in the given <class>SYS.X509Credentials</class> object.
Input parameters:
Output parameters:
Return value:
Notes:
Set sc=##class(Net.JSON.JWK).CreateX509("RS256",x509,.privJWK,.pubJWK) If $$$ISOK(sc) { Set privJWK.kid=1 Set pubJWK.kid=1 }
Set sc=##class(Net.JSON.JWK).CreateX509("RS256",x509,.privJWK,.pubJWK) If $$$ISOK(sc) { Set privJWK=privJWK.ToJSON() Set pubJWK=pubJWK.ToJSON() Do ##class(Net.JSON.JWE).Encrypt({"alg":"RSA1_5","enc":"A256CBC-HS512"},,,privJWK,,,JWKS,.encryptedPrivJWK) Do ##class(Net.JSON.JWE).Encrypt({"alg":"RSA1_5","enc":"A256CBC-HS512"},,,pubJWK,,,JWKS,.encryptedPubJWK) }<br<blockquote>
Where JWKS is a JWKS that contains a key for RSA1_5. This method will return an error if an unrecognized algorithm is used. Assuming creation was successful, pubJWK will always have a non-null value.
|
static |
This method converts a key in JSON Web Key (JWK) format to PEM-encoded DER ASN.1 format.
Input parameters:
Output parameters:
Return value:
Notes: