From bd85221d5ca6d4580efd69d40e37237ade79b20d Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 1 Aug 2016 16:10:49 -0700 Subject: Service call implementation with crypto and service discovery --- src/main/scala/com/drivergrp/core/crypto.scala | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/main/scala/com/drivergrp/core/crypto.scala (limited to 'src/main/scala/com/drivergrp/core/crypto.scala') diff --git a/src/main/scala/com/drivergrp/core/crypto.scala b/src/main/scala/com/drivergrp/core/crypto.scala new file mode 100644 index 0000000..2910260 --- /dev/null +++ b/src/main/scala/com/drivergrp/core/crypto.scala @@ -0,0 +1,23 @@ +package com.drivergrp.core + +object crypto { + + final case class Macaroon(value: String) + + final case class Base64[T](value: String) + + final case class AuthToken(value: Base64[Macaroon]) + + final case class EncryptionKey(value: String) + + final case class DecryptionKey(value: String) + + trait Crypto { + + def keyForToken(authToken: AuthToken): EncryptionKey + + def encrypt(encryptionKey: EncryptionKey)(message: Array[Byte]): Array[Byte] + + def decrypt(decryptionKey: EncryptionKey)(message: Array[Byte]): Array[Byte] + } +} -- cgit v1.2.3