Class Crypto

    • Constructor Detail

      • Crypto

        public Crypto()
    • Method Detail

      • getJwkUtil

        public edu.uiuc.ncsa.security.util.jwk.JWKUtil2 getJwkUtil()
      • addTypeHelp

        protected void addTypeHelp​(List<String> dd)
      • exportJWKS

        protected Object exportJWKS​(Object[] objects,
                                    State state)
                             throws Throwable
        Does the actual work of exporting a JWKS set.
        Parameters:
        objects -
        state -
        Returns:
        Throws:
        Throwable
      • exportPKCS

        protected Object exportPKCS​(Object[] objects,
                                    State state)
                             throws Throwable
        Does the actual work or exporting various PKCS files.
        Parameters:
        objects -
        state -
        Returns:
        Throws:
        Throwable
      • getKeyTypes

        public QDLStem getKeyTypes()
      • getJwk

        public static com.nimbusds.jose.jwk.JWK getJwk​(PublicKey publicKey)
      • getKeys

        protected edu.uiuc.ncsa.security.util.jwk.JSONWebKey getKeys​(QDLStem keys)
      • webKeyToStem

        public static QDLStem webKeyToStem​(edu.uiuc.ncsa.security.util.jwk.JSONWebKey jsonWebKey)
      • sDeOrEnCrypt

        public Object sDeOrEnCrypt​(Object[] objects,
                                   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:
      • getRandomID

        public static String getRandomID()
      • getRandomID

        public static String getRandomID​(int byteCount)
        Creates a random id as an (upper case) hex number.
        Parameters:
        byteCount -
        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 interface QDLMetaModule
        Returns:
      • isAES

        protected boolean isAES​(QDLStem key)
        Tests if a given stem that is a key is an AES i.e., symmetric key.
        Parameters:
        key -
        Returns:
      • isEC

        protected boolean isEC​(QDLStem key)
      • isRSA

        protected boolean isRSA​(QDLStem key)