Class MosipRSA


  • public class MosipRSA
    extends AsymmetricProcessor
    RSA Engine Initialization
    Since:
    1.0.0
    Author:
    Urvil Joshi
    • Method Detail

      • hybridRsaAesWithPKCS1Padding

        public static byte[] hybridRsaAesWithPKCS1Padding​(org.bouncycastle.crypto.params.AsymmetricKeyParameter key,
                                                          byte[] data,
                                                          boolean mode)
                                                   throws MosipInvalidDataException,
                                                          MosipInvalidKeyException
        Hybrid RSA Engine Initialization with PKCS1Padding
        Parameters:
        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 in length,corrupted
        MosipInvalidKeyException - if key is not valid in length,corrupted and wrong
      • hybridRsaAesWithOAEPWithMD5AndMGF1Padding

        public static byte[] hybridRsaAesWithOAEPWithMD5AndMGF1Padding​(org.bouncycastle.crypto.params.AsymmetricKeyParameter key,
                                                                       byte[] data,
                                                                       boolean mode)
                                                                throws MosipInvalidDataException,
                                                                       MosipInvalidKeyException
        Hybrid RSA Engine Initialization with OAEP(MD5AndMGF1)Padding
        Parameters:
        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 in length,corrupted
        MosipInvalidKeyException - If key is not valid in length,corrupted and wrong
      • hybridRsaAesWithOAEPWithSHA3512AndMGF1Padding

        public static byte[] hybridRsaAesWithOAEPWithSHA3512AndMGF1Padding​(org.bouncycastle.crypto.params.AsymmetricKeyParameter key,
                                                                           byte[] data,
                                                                           boolean mode)
                                                                    throws MosipInvalidDataException,
                                                                           MosipInvalidKeyException
        Hybrid RSA Engine Initialization with OAEP(SHA3512AndMGF1)Padding
        Parameters:
        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 in length,corrupted
        MosipInvalidKeyException - If key is not valid in length,corrupted and wrong
      • rsaWithPKCS1Padding

        public static byte[] rsaWithPKCS1Padding​(org.bouncycastle.crypto.params.AsymmetricKeyParameter key,
                                                 byte[] data,
                                                 boolean mode)
                                          throws MosipInvalidDataException,
                                                 MosipInvalidKeyException
        RSA Engine Initialization with PKCS1Padding
        Parameters:
        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 in length,corrupted
        MosipInvalidKeyException - If key is not valid in length,corrupted and wrong
      • rsaWithOAEPWithMD5AndMGF1Padding

        public static byte[] rsaWithOAEPWithMD5AndMGF1Padding​(org.bouncycastle.crypto.params.AsymmetricKeyParameter key,
                                                              byte[] data,
                                                              boolean mode)
                                                       throws MosipInvalidDataException,
                                                              MosipInvalidKeyException
        RSA Engine Initialization with OAEP(MD5AndMGF1)Padding
        Parameters:
        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 in length,corrupted
        MosipInvalidKeyException - If key is not valid in length,corrupted and wrong
      • rsaWithOAEPWithSHA3512AndMGF1Padding

        public static byte[] rsaWithOAEPWithSHA3512AndMGF1Padding​(org.bouncycastle.crypto.params.AsymmetricKeyParameter key,
                                                                  byte[] data,
                                                                  boolean mode)
                                                           throws MosipInvalidDataException,
                                                                  MosipInvalidKeyException
        RSA Engine Initialization with OAEP(SHA3512AndMGF1)Padding
        Parameters:
        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 in length,corrupted
        MosipInvalidKeyException - If key is not valid in length,corrupted and wrong