Package 

Class RSACrypt

  • All Implemented Interfaces:

    
    public class RSACrypt
    
                        

    Encrypt and decrypt bytes or a string.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static String encrypt(PublicKey publicKey, String message) Encrypt a string with an RSA public key.
      static String encrypt(PublicKey publicKey, Array<byte> bytes) Encrypt a byte array with an RSA public key.
      static String decryptToString(PrivateKey privateKey, String message) Decrypt a base 64 encrypted message with an RSA private key.
      static Array<byte> decryptToBytes(PrivateKey privateKey, String message) Decrypt a base 64 encrypted message with an RSA private key.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • encrypt

         static String encrypt(PublicKey publicKey, String message)

        Encrypt a string with an RSA public key.

        Parameters:
        publicKey - The public key which is used to encrypt the message.
        message - The message to encrypt.
      • encrypt

         static String encrypt(PublicKey publicKey, Array<byte> bytes)

        Encrypt a byte array with an RSA public key.

        Parameters:
        publicKey - The public key which is used to encrypt the bytes.
        bytes - The bytes to encrypt.
      • decryptToString

         static String decryptToString(PrivateKey privateKey, String message)

        Decrypt a base 64 encrypted message with an RSA private key.

        Parameters:
        privateKey - The private key which is used to decrypt the message.
        message - The base 64 encrypted message to encrypt.
      • decryptToBytes

         static Array<byte> decryptToBytes(PrivateKey privateKey, String message)

        Decrypt a base 64 encrypted message with an RSA private key.

        Parameters:
        privateKey - The private key which is used to decrypt the message.
        message - The base 64 encrypted message to encrypt.