Package org.qdl_lang.extensions.crypto
Class Crypto
- java.lang.Object
-
- org.qdl_lang.extensions.crypto.Crypto
-
- All Implemented Interfaces:
Serializable
,QDLMetaModule
public class Crypto extends Object implements QDLMetaModule
Created by Jeff Gaynor
on 8/16/22 at 1:34 PM- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Crypto.CreateKey
class
Crypto.Decrypt
class
Crypto.Encrypt
class
Crypto.ExportJWKS
class
Crypto.GetPublicKey
Get the public part of a keyclass
Crypto.ImportJWKS
Read key set from a fileclass
Crypto.SymmetricDecrypt
class
Crypto.SymmetricEncrypt
-
Field Summary
Fields Modifier and Type Field Description static String
CREATE_KEY_NAME
static String
DECRYPT_NAME
static String
ENCRYPT_NAME
static String
EXPORT_KEYS_NAME
static String
GET_PUBLIC_KEY_NAME
static String
IMPORT_KEYS_NAME
static String
SYMM_DECRYPT_NAME
static String
SYMM_ENCRYPT_NAME
-
Constructor Summary
Constructors Constructor Description Crypto()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
decodeString(byte[] key, String s, boolean isEncrypt)
Utility for symmetric key encode/decode.void
deserializeFromJSON(net.sf.json.JSONObject json)
edu.uiuc.ncsa.security.util.jwk.JWKUtil2
getJwkUtil()
protected edu.uiuc.ncsa.security.util.jwk.JSONWebKey
getKeys(QDLStem keys)
protected boolean
isSingleKey(QDLStem stem)
Is the stem a single key or a stem of keys? This is a simple-minded test and just checks if a required value for the keyis at the top level.Object
sDeOrEnCrypt(Object[] objects, State state, boolean isEncrypt, String name)
net.sf.json.JSONObject
serializeToJSON()
Send back a serialization of internal state for this object.void
setJwkUtil(edu.uiuc.ncsa.security.util.jwk.JWKUtil2 jwkUtil)
protected QDLStem
webKeyToStem(edu.uiuc.ncsa.security.util.jwk.JSONWebKey jsonWebKey)
-
-
-
Field Detail
-
CREATE_KEY_NAME
public static final String CREATE_KEY_NAME
- See Also:
- Constant Field Values
-
IMPORT_KEYS_NAME
public static final String IMPORT_KEYS_NAME
- See Also:
- Constant Field Values
-
EXPORT_KEYS_NAME
public static final String EXPORT_KEYS_NAME
- See Also:
- Constant Field Values
-
GET_PUBLIC_KEY_NAME
public static final String GET_PUBLIC_KEY_NAME
- See Also:
- Constant Field Values
-
ENCRYPT_NAME
public static final String ENCRYPT_NAME
- See Also:
- Constant Field Values
-
DECRYPT_NAME
public static final String DECRYPT_NAME
- See Also:
- Constant Field Values
-
SYMM_ENCRYPT_NAME
public static final String SYMM_ENCRYPT_NAME
- See Also:
- Constant Field Values
-
SYMM_DECRYPT_NAME
public static final String SYMM_DECRYPT_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getJwkUtil
public edu.uiuc.ncsa.security.util.jwk.JWKUtil2 getJwkUtil()
-
setJwkUtil
public void setJwkUtil(edu.uiuc.ncsa.security.util.jwk.JWKUtil2 jwkUtil)
-
getKeys
protected edu.uiuc.ncsa.security.util.jwk.JSONWebKey getKeys(QDLStem keys)
-
webKeyToStem
protected QDLStem webKeyToStem(edu.uiuc.ncsa.security.util.jwk.JSONWebKey jsonWebKey)
-
decodeString
protected String decodeString(byte[] key, String s, boolean isEncrypt)
Utility for symmetric key encode/decode.- Parameters:
key
-s
-isEncrypt
-- Returns:
-
sDeOrEnCrypt
public Object sDeOrEnCrypt(Object[] objects, State state, boolean isEncrypt, String name)
-
isSingleKey
protected boolean isSingleKey(QDLStem stem)
Is the stem a single key or a stem of keys? This is a simple-minded test and just checks if a required value for the keyis at the top level.- Parameters:
stem
-- Returns:
-
serializeToJSON
public net.sf.json.JSONObject serializeToJSON()
Description copied from interface:QDLMetaModule
Send back a serialization of internal state for this object. This allows for the state you choose to be serialized and then reloaded.NOTE
There is no canonical form for this. Set it how you will and deserialize it accordingly.- Specified by:
serializeToJSON
in interfaceQDLMetaModule
- Returns:
-
deserializeFromJSON
public void deserializeFromJSON(net.sf.json.JSONObject json)
- Specified by:
deserializeFromJSON
in interfaceQDLMetaModule
-
-