MessageCrypto

fm.common.MessageCrypto
See theMessageCrypto companion object
final class MessageCrypto(key: Array[Byte], json: Boolean)

Compatible with the Rails MessageEncryptor using 'aes-256-cbc' and MessageVerifier using 'sha1' when working with String values.

Also compatible with the custom MessageCrypto which marshalls values as JSON instead of using the ruby Marshal.dump and Marshal.load. Use json=true to dump using JSON.

MessageEncryptor uses Marshal.dump and Marshal.load on whatever values you are trying to encrypt/sign. A subset of Marshal.dump and Marshal.load have been implemented to support String values.

NOTE: This is a legacy class that was created when we switched from Rails to Scala. It is still used in a few places but probably needs to be refactored to remove the old Ruby marshalling stuff.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Classlikes

final class RubyUnmarshalStream(bytes: Array[Byte])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Constructors

def this(key: String)
def this(key: String, json: Boolean)

Concrete methods

def decrypt(msg: String): String
def decryptAndVerify(msg: String): Option[String]
def encrypt(msg: String): String
def encryptAndSign(msg: String): String
def hexHmac(msg: String): String
def sign(msg: String): String
def verify(msg: String): Option[String]