Class RsaRawEncryptor

java.lang.Object
org.springframework.security.rsa.crypto.RsaRawEncryptor
All Implemented Interfaces:
org.springframework.security.crypto.encrypt.BytesEncryptor, org.springframework.security.crypto.encrypt.TextEncryptor, RsaKeyHolder

public class RsaRawEncryptor extends Object implements org.springframework.security.crypto.encrypt.BytesEncryptor, org.springframework.security.crypto.encrypt.TextEncryptor, RsaKeyHolder
Author:
Dave Syer
  • Constructor Details

    • RsaRawEncryptor

      public RsaRawEncryptor(RsaAlgorithm algorithm)
    • RsaRawEncryptor

      public RsaRawEncryptor()
    • RsaRawEncryptor

      public RsaRawEncryptor(KeyPair keyPair, RsaAlgorithm algorithm)
    • RsaRawEncryptor

      public RsaRawEncryptor(KeyPair keyPair)
    • RsaRawEncryptor

      public RsaRawEncryptor(String pemData)
    • RsaRawEncryptor

      public RsaRawEncryptor(PublicKey publicKey)
    • RsaRawEncryptor

      public RsaRawEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey)
    • RsaRawEncryptor

      public RsaRawEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey, RsaAlgorithm algorithm)
  • Method Details

    • getPublicKey

      public String getPublicKey()
      Specified by:
      getPublicKey in interface RsaKeyHolder
    • encrypt

      public String encrypt(String text)
      Specified by:
      encrypt in interface org.springframework.security.crypto.encrypt.TextEncryptor
    • decrypt

      public String decrypt(String encryptedText)
      Specified by:
      decrypt in interface org.springframework.security.crypto.encrypt.TextEncryptor
    • encrypt

      public byte[] encrypt(byte[] byteArray)
      Specified by:
      encrypt in interface org.springframework.security.crypto.encrypt.BytesEncryptor
    • decrypt

      public byte[] decrypt(byte[] encryptedByteArray)
      Specified by:
      decrypt in interface org.springframework.security.crypto.encrypt.BytesEncryptor