Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CHK
- data Reader
- readKey :: Lens' Reader (Key AES128)
- verifier :: Lens' Reader Verifier
- data Verifier
- storageIndex :: Lens' Verifier ByteString
- fingerprint :: Lens' Verifier ByteString
- required :: Lens' Verifier Word16
- total :: Lens' Verifier Word16
- size :: Lens' Verifier Integer
- makeReader :: Key AES128 -> ByteString -> Word16 -> Word16 -> Integer -> Reader
- pCapability :: Parser CHK
- pVerifier :: Parser Verifier
- pReader :: Parser Reader
- dangerRealShow :: CHK -> Text
Documentation
A "Content-Hash-Key" (CHK) capability is small value that can be used to perform some operation on a (usually) larger value that may be stored somewhere else. There are two forms of CHK capabilities: verify and read. See *Verifier* and *Reader* for details.
Represent a CHK "read" capability. This capability type can be diminished to a verify capability so it confers all of the abilities of a verify capability. It can also be used to decrypt shares to reconstruct the original plaintext. See makeReader for a safe constructor that correctly derives the verify capability.
Instances
Eq Reader Source # | |
Ord Reader Source # | |
Show Reader Source # | Give it a Show instance that elides the sensitive material. This makes it easier to compose with other types and we can still learn a lot of useful things about a capability without being able to see the literal secret key. |
ToExpr Reader Source # | |
Defined in Tahoe.CHK.Capability |
Represent a CHK "verify" capability. This capability type can be used to verify the existence and validity (bit-level) of shares for the associated piece of plaintext.
It can also be used to repair unhealthy data (I think?)
Instances
Eq Verifier Source # | |
Ord Verifier Source # | |
Defined in Tahoe.CHK.Capability | |
Show Verifier Source # | |
Generic Verifier Source # | |
ToExpr Verifier Source # | |
Defined in Tahoe.CHK.Capability | |
type Rep Verifier Source # | |
Defined in Tahoe.CHK.Capability type Rep Verifier = D1 ('MetaData "Verifier" "Tahoe.CHK.Capability" "tahoe-chk-0.2.0.0-inplace" 'False) (C1 ('MetaCons "Verifier" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_storageIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "_fingerprint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :*: (S1 ('MetaSel ('Just "_required") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16) :*: (S1 ('MetaSel ('Just "_total") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16) :*: S1 ('MetaSel ('Just "_size") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))))) |
makeReader :: Key AES128 -> ByteString -> Word16 -> Word16 -> Integer -> Reader Source #
Construct a CHK read capability from its components. This includes the correct derivation of the corresponding CHK verify capability.
pCapability :: Parser CHK Source #
A parser combinator for parsing either a verify or read CHK capability from the canonical format. This is the moral inverse of dangerRealShow.
dangerRealShow :: CHK -> Text Source #
Serialize a CHK capability to text. This operation is "dangerous" in that it will serialize the encryption key of a read capability into the text. Since the encryption key is necessary and (practically) sufficient to recover the original plaintext associated with the capability, it must be handled carefully to avoid unintentional disclosure. Serializing the key to a string is a good way to accidentally disclose it! Be warned.
The text is in the canonical form, originally used by the Python implementation of Tahoe-LAFS.