diff options
author | vlad <vlad@drivergrp.com> | 2016-08-01 16:10:49 -0700 |
---|---|---|
committer | vlad <vlad@drivergrp.com> | 2016-08-01 16:10:49 -0700 |
commit | bd85221d5ca6d4580efd69d40e37237ade79b20d (patch) | |
tree | 74042c80a58c726c90dd62737dd7d3d32a637272 /src/main/scala/com/drivergrp/core/crypto.scala | |
parent | 1f8a7112150b74175dc87c9df09ec796f6c3fdeb (diff) | |
download | driver-core-bd85221d5ca6d4580efd69d40e37237ade79b20d.tar.gz driver-core-bd85221d5ca6d4580efd69d40e37237ade79b20d.tar.bz2 driver-core-bd85221d5ca6d4580efd69d40e37237ade79b20d.zip |
Service call implementation with crypto and service discovery
Diffstat (limited to 'src/main/scala/com/drivergrp/core/crypto.scala')
-rw-r--r-- | src/main/scala/com/drivergrp/core/crypto.scala | 23 |
1 files changed, 23 insertions, 0 deletions
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] + } +} |