Class/Object

fm.common

Crypto

Related Docs: object Crypto | package common

Permalink

final class Crypto extends Logging

A Simple Crypto Class

NOTE: Use at your own risk. We make no claim that any of this Crypto code is correct.

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Crypto
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Crypto(base64Key: String)

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version ) Use the Crypto object factory methods instead of directly calling this constructor. e.g. Crypto.defaultCipherForRawKey or Crypto.defaultCipherForBase64Key

  2. new Crypto(key: Array[Byte])

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version ) Use the Crypto object factory methods instead of directly calling this constructor. e.g. Crypto.defaultCipherForRawKey or Crypto.defaultCipherForBase64Key

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def decrypt(iv: Array[Byte], ciphertext: Array[Byte]): Array[Byte]

    Permalink

    Decrypt given the IV and Ciphertext

  7. def decrypt(ivAndCiphertext: Array[Byte]): Array[Byte]

    Permalink

    Decrypt given the combined IV and Ciphertext

  8. def decryptBase64String(base64IvAndCiphertext: String): String

    Permalink

    Decrypt a string encrypted using encryptBase64String()

  9. def encrypt(plaintext: Array[Byte]): Array[Byte]

    Permalink

    Encrypt bytes returning the iv and ciphertext combined into a single byte array (iv followed by the cipher text)

  10. def encryptBase64String(plaintext: String, urlSafe: Boolean): String

    Permalink
  11. def encryptBase64String(plaintext: String): String

    Permalink
  12. def encryptBase64StringURLSafe(plaintext: String): String

    Permalink
  13. def encryptRaw(plaintext: Array[Byte]): (Array[Byte], Array[Byte])

    Permalink

    Encrypt Bytes returning the tuple: (iv, ciphertext)

  14. def encryptRaw(plaintext: String): (Array[Byte], Array[Byte])

    Permalink

    Encrypt a string returning the tuple: (iv, ciphertext)

  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  22. def mac(data: Array[Byte]): Array[Byte]

    Permalink

    Calculate the MAC for an array of bytes

  23. def macBase64(data: Array[Byte], urlSafe: Boolean): String

    Permalink
  24. def macBase64(data: Array[Byte]): String

    Permalink

    The Base64 Encoded MAC for an array of bytes

  25. def macBase64(data: String, urlSafe: Boolean): String

    Permalink
  26. def macBase64(data: String): String

    Permalink
  27. def macBase64URLSafe(data: Array[Byte]): String

    Permalink
  28. def macBase64URLSafe(data: String): String

    Permalink
  29. def macHex(data: Array[Byte]): String

    Permalink

    The Hex Encoded MAC for an array of bytes

  30. def macHex(data: String): String

    Permalink

    The Hex Encoded MAC for a String

  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. def tryDecrypt(iv: Array[Byte], ciphertext: Array[Byte]): Option[Array[Byte]]

    Permalink
  37. def tryDecrypt(ivAndCiphertext: Array[Byte]): Option[Array[Byte]]

    Permalink
  38. def tryDecryptBase64String(base64IvAndCiphertext: String): Option[String]

    Permalink

    Attempt to decrypt a string encrypted using encryptBase64String()

    Attempt to decrypt a string encrypted using encryptBase64String()

    If successful then Some(plaintext) will be returned. Otherwise None will be returned.

  39. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped