abstract class SignedCodec[A] extends Codec[A]
A codec that delegates through to the provided target codec but prefixes the encoded value with an HMAC signature when encoding and verifies the signature when decoding. This ensures that the encoded bits were not tampered with.
- Source
- SignedCodec.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- SignedCodec
- Codec
- GenCodec
- Decoder
- Encoder
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
- new SignedCodec()
Abstract Value Members
- abstract def signature(bits: BitVector): Attempt[ByteVector]
-
abstract
def
signatureCodec: Codec[BitVector]
The codec to use for the signature portion of the encoded bits.
- abstract def signingKey: SignatureKey
-
abstract
def
targetCodec: Codec[A]
Returns the underlying codec that is to be used before the signature is applied
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
:+:[B](left: Codec[B]): CoproductCodecBuilder[:+:[B, :+:[A, CNil]], ::[Codec[B], ::[Codec[A], HNil]], :+:[B, :+:[A, CNil]]]
- Definition Classes
- Codec
-
final
def
<~[B](codecB: Codec[B])(implicit ev: =:=[Unit, B]): Codec[A]
- Definition Classes
- Codec
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
>>~[B](f: (A) ⇒ Codec[B]): Codec[(A, B)]
- Definition Classes
- Codec
-
def
asDecoder: Decoder[A]
- Definition Classes
- Decoder
-
def
asEncoder: Encoder[A]
- Definition Classes
- Encoder
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
compact: Codec[A]
- Definition Classes
- Codec → GenCodec → Encoder
-
final
def
complete: Codec[A]
- Definition Classes
- Codec → GenCodec → Decoder
-
final
def
consume[B](f: (A) ⇒ Codec[B])(g: (B) ⇒ A): Codec[B]
- Definition Classes
- Codec
-
def
contramap[C](f: (C) ⇒ A): GenCodec[C, A]
- Definition Classes
- GenCodec → Encoder
-
final
def
decode(bits: BitVector): Attempt[DecodeResult[A]]
- Definition Classes
- SignedCodec → Decoder
-
def
decodeOnly[AA >: A]: Codec[AA]
- Definition Classes
- Codec → Decoder
-
final
def
decodeValue(bits: BitVector): Attempt[A]
- Definition Classes
- Decoder
-
final
def
downcast[B <: A](implicit tb: Typeable[B]): Codec[B]
- Definition Classes
- Codec
-
final
def
dropLeft[B](codecB: Codec[B])(implicit ev: =:=[Unit, A]): Codec[B]
- Definition Classes
- Codec
-
final
def
dropRight[B](codecB: Codec[B])(implicit ev: =:=[Unit, B]): Codec[A]
- Definition Classes
- Codec
-
def
econtramap[C](f: (C) ⇒ Attempt[A]): GenCodec[C, A]
- Definition Classes
- GenCodec → Encoder
-
def
emap[C](f: (A) ⇒ Attempt[C]): GenCodec[A, C]
- Definition Classes
- GenCodec → Decoder
-
final
def
encode(a: A): Attempt[BitVector]
- Definition Classes
- SignedCodec → Encoder
-
def
encodeOnly: Codec[A]
- Definition Classes
- Encoder
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
exmap[B](f: (A) ⇒ Attempt[B], g: (B) ⇒ Attempt[A]): Codec[B]
- Definition Classes
- Codec
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (A) ⇒ Decoder[B]): Decoder[B]
- Definition Classes
- Decoder
-
final
def
flatZip[B](f: (A) ⇒ Codec[B]): Codec[(A, B)]
- Definition Classes
- Codec
-
final
def
flattenLeftPairs(implicit f: FlattenLeftPairs[A]): Codec[Out]
- Definition Classes
- Codec
-
final
def
fuse[AA <: A, BB >: A](implicit ev: =:=[BB, AA]): Codec[BB]
- Definition Classes
- GenCodec
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
hlist: Codec[::[A, HNil]]
- Definition Classes
- Codec
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[C](f: (A) ⇒ C): GenCodec[A, C]
- Definition Classes
- GenCodec → Decoder
-
final
def
narrow[B](f: (A) ⇒ Attempt[B], g: (B) ⇒ A): Codec[B]
- Definition Classes
- Codec
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
pairedWith[B](codecB: Codec[B]): Codec[(A, B)]
- Definition Classes
- Codec
-
def
pcontramap[C](f: (C) ⇒ Option[A]): GenCodec[C, A]
- Definition Classes
- GenCodec → Encoder
-
def
sizeBound: SizeBound
- Definition Classes
- SignedCodec → Encoder
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toField[K]: Codec[FieldType[K, A]]
- Definition Classes
- Codec
-
def
toFieldWithContext[K <: Symbol](k: K): Codec[FieldType[K, A]]
- Definition Classes
- Codec
-
def
toString(): String
- Definition Classes
- SignedCodec → AnyRef → Any
-
final
def
unit(zero: A): Codec[Unit]
- Definition Classes
- Codec
-
final
def
upcast[B >: A](implicit ta: Typeable[A]): Codec[B]
- Definition Classes
- Codec
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
widen[B](f: (A) ⇒ B, g: (B) ⇒ Attempt[A]): Codec[B]
- Definition Classes
- Codec
-
final
def
withContext(context: String): Codec[A]
- Definition Classes
- Codec
-
final
def
withToString(str: ⇒ String): Codec[A]
- Definition Classes
- Codec
-
final
def
xmap[B](f: (A) ⇒ B, g: (B) ⇒ A): Codec[B]
- Definition Classes
- Codec
-
final
def
~[B](codecB: Codec[B]): Codec[(A, B)]
- Definition Classes
- Codec
-
final
def
~>[B](codecB: Codec[B])(implicit ev: =:=[Unit, A]): Codec[B]
- Definition Classes
- Codec