Class SymmetricProcessor

  • Direct Known Subclasses:
    MosipAES, MosipDES, MosipTWOFISH

    public class SymmetricProcessor
    extends Object
    Symmetric Encryption/Decryption processor
    Since:
    1.0.0
    Author:
    Urvil Joshi
    • Constructor Detail

      • SymmetricProcessor

        protected SymmetricProcessor()
        Constructor for this class
    • Method Detail

      • process

        protected static byte[] process​(org.bouncycastle.crypto.BlockCipher blockCipher,
                                        byte[] key,
                                        byte[] data,
                                        boolean mode)
                                 throws MosipInvalidKeyException,
                                        MosipInvalidDataException
        Symmetric Encryption/Decryption processor
        Parameters:
        blockCipher - initialized Symmetric block cipher
        key - key for encryption/decryption
        data - data for encryption/decryption
        mode - if true process mode is Encrypt ,else process mode is Decrypt
        Returns:
        Processed array
        Throws:
        MosipInvalidDataException - if data is not valid(length or form)
        MosipInvalidKeyException - if key is not valid (length or form)