Class RSA

    • Constructor Summary

      Constructors 
      Constructor Description
      RSA()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] decrypt​(java.security.PrivateKey privateKey, byte[] data)
      Decrypt byte[] data
      java.lang.String decrypt​(java.security.PrivateKey privateKey, java.lang.String data)
      Decrypt string data
      byte[] encrypt​(java.security.PublicKey publicKey, byte[] data)
      Encrypt byte[] data
      java.lang.String encrypt​(java.security.PublicKey publicKey, java.lang.String data)
      Encrypt string data
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RSA

        public RSA()
    • Method Detail

      • encrypt

        public java.lang.String encrypt​(java.security.PublicKey publicKey,
                                        java.lang.String data)
                                 throws java.lang.Exception
        Description copied from interface: AsymmetricEncryptionAlgorithm
        Encrypt string data
        Specified by:
        encrypt in interface AsymmetricEncryptionAlgorithm
        Parameters:
        publicKey - Public key
        data - Data to encrypt
        Returns:
        encryptedData Encrypted data
        Throws:
        java.lang.Exception - Encryption error
      • encrypt

        public byte[] encrypt​(java.security.PublicKey publicKey,
                              byte[] data)
                       throws java.lang.Exception
        Description copied from interface: AsymmetricEncryptionAlgorithm
        Encrypt byte[] data
        Specified by:
        encrypt in interface AsymmetricEncryptionAlgorithm
        Parameters:
        publicKey - Public key
        data - Data to encrypt
        Returns:
        encryptedData Encrypted data
        Throws:
        java.lang.Exception - Encryption error
      • decrypt

        public java.lang.String decrypt​(java.security.PrivateKey privateKey,
                                        java.lang.String data)
                                 throws java.lang.Exception
        Description copied from interface: AsymmetricEncryptionAlgorithm
        Decrypt string data
        Specified by:
        decrypt in interface AsymmetricEncryptionAlgorithm
        Parameters:
        privateKey - Private key
        data - Data to decrypt
        Returns:
        decryptedData Decrypted data
        Throws:
        java.lang.Exception - Decryption error
      • decrypt

        public byte[] decrypt​(java.security.PrivateKey privateKey,
                              byte[] data)
                       throws java.lang.Exception
        Description copied from interface: AsymmetricEncryptionAlgorithm
        Decrypt byte[] data
        Specified by:
        decrypt in interface AsymmetricEncryptionAlgorithm
        Parameters:
        privateKey - Private key
        data - Data to decrypt
        Returns:
        decryptedData Decrypted data
        Throws:
        java.lang.Exception - Decryption error