Class JCEEncryption

  • All Implemented Interfaces:
    AMEncryption, ConfigurableKey

    public class JCEEncryption
    extends Object
    implements AMEncryption, ConfigurableKey

    This class provides encryption and decryption facility for the SDK based on the existence of a JCE provider in the runtime. Unlike JSSEncryption, this class can only handle a fixed algorithm for key generation and encryption which is PBEWithMD5AndDES. Since different JCE providers such as IAIK use slightly different names for this algorithm, this class provides the facility to over-ride this hardcoded value by setting the system properties for each of these algorithms. The property name for specifying the key generation algorithm is amKeyGenDescriptor and that for specifying encryption algorithm is amCryptoDescriptor.

    NOTE: The facility of overriding key generation and encryption algorithms must be used very carefully. In particular, this facility is not meant to force the use of an algorithm different from the specified default algorithm PBEWithMD5AndDES since that will result in incompatibility between the JSSEncryption if it is being used by any peer entity such as agent or server. This would not be a problem if all entities in the network were configured to use this encryption provider and all had the same implementation of the specified algorithms available.

    • Constructor Detail

      • JCEEncryption

        public JCEEncryption()
    • Method Detail

      • encrypt

        public byte[] encrypt​(byte[] clearText)
        Method declaration
        Specified by:
        encrypt in interface AMEncryption
        Parameters:
        clearText -
      • decrypt

        public byte[] decrypt​(byte[] encText)
        Method declaration
        Specified by:
        decrypt in interface AMEncryption
        Parameters:
        encText -