tahoe-chk-0.2.0.0: The Tahoe-LAFS' Content-Hash-Key (CHK) cryptographic protocol.
Safe HaskellNone
LanguageHaskell2010

Tahoe.CHK.Capability

Synopsis

Documentation

data CHK Source #

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.

Instances

Instances details
Eq CHK Source # 
Instance details

Defined in Tahoe.CHK.Capability

Methods

(==) :: CHK -> CHK -> Bool #

(/=) :: CHK -> CHK -> Bool #

Ord CHK Source # 
Instance details

Defined in Tahoe.CHK.Capability

Methods

compare :: CHK -> CHK -> Ordering #

(<) :: CHK -> CHK -> Bool #

(<=) :: CHK -> CHK -> Bool #

(>) :: CHK -> CHK -> Bool #

(>=) :: CHK -> CHK -> Bool #

max :: CHK -> CHK -> CHK #

min :: CHK -> CHK -> CHK #

data Reader Source #

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

Instances details
Eq Reader Source # 
Instance details

Defined in Tahoe.CHK.Capability

Methods

(==) :: Reader -> Reader -> Bool #

(/=) :: Reader -> Reader -> Bool #

Ord Reader Source # 
Instance details

Defined in Tahoe.CHK.Capability

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.

Instance details

Defined in Tahoe.CHK.Capability

ToExpr Reader Source # 
Instance details

Defined in Tahoe.CHK.Capability

Methods

toExpr :: Reader -> Expr #

listToExpr :: [Reader] -> Expr #

data Verifier Source #

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

Instances details
Eq Verifier Source # 
Instance details

Defined in Tahoe.CHK.Capability

Ord Verifier Source # 
Instance details

Defined in Tahoe.CHK.Capability

Show Verifier Source # 
Instance details

Defined in Tahoe.CHK.Capability

Generic Verifier Source # 
Instance details

Defined in Tahoe.CHK.Capability

Associated Types

type Rep Verifier :: Type -> Type #

Methods

from :: Verifier -> Rep Verifier x #

to :: Rep Verifier x -> Verifier #

ToExpr Verifier Source # 
Instance details

Defined in Tahoe.CHK.Capability

type Rep Verifier Source # 
Instance details

Defined in Tahoe.CHK.Capability

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.

pVerifier :: Parser Verifier Source #

A parser combinator for parsing a CHK verify capability.

pReader :: Parser Reader Source #

A parser combinator for parsing a CHK read capability.

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.