trust-chain 0.1.1.0 → 0.1.1.1
raw patch · 2 files changed
+41/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +39/−0
- trust-chain.cabal +2/−2
+ README.md view
@@ -0,0 +1,39 @@+# Trust Chain++An implementation of a trust chain parameterized on structure and content. As an example:++```haskell+type Time = Integer++data Person = Person+ { pubKey :: PublicKey+ , legalName :: Maybe Text+ , emails :: Set Text+ , posts :: Set (Time, Text)+ }+ deriving (Eq, Ord, Binary, Generic)++mergePerson :: Merge [String] Person Person+mergePerson =+ Person+ <$> required pubKey+ <*> optional legalName+ <*> combine emails+ <*> combine posts++person :: IO ()+person = do+ privateKey0 <- generatePrivateKey KeySize256+ privateKey1 <- generatePrivateKey KeySize256+ let myself = Person (privateToPublic privateKey0) (Just "Samuel Schlesinger") (Set.fromList ["sgschlesinger@gmail.com", "samuel@simspace.com"]) (Set.fromList [])+ let myfriend = Person (privateToPublic privateKey1) (Just "My Friend") (Set.fromList ["friend@friendly.com"]) Set.empty+ let partialfriend = Person (privateToPublic privateKey1) Nothing Set.empty Set.empty+ tc0 <- mkTrustProxy privateKey0 [Trustless myself, Trustless partialfriend]+ tc1 <- mkTrustProxy privateKey1 [Trustless myfriend]+ tc0' <- mkTrustProxy privateKey0 [tc0, tc1]+ tc1' <- mkTrustProxy privateKey1 [tc0, tc1]+ requires "person"+ [ assignments pubKey mergePerson (claims tc1') == assignments pubKey mergePerson (claims tc0')+ , assignments pubKey mergePerson (claims tc0') == Right (Map.fromList [(privateToPublic privateKey0, myself), (privateToPublic privateKey1, myfriend)])+ ]+```
trust-chain.cabal view
@@ -1,13 +1,13 @@ cabal-version: 2.4 name: trust-chain-version: 0.1.1.0+version: 0.1.1.1 category: Cryptography, Crypto synopsis: An implementation of a trust chain license: MIT description: An implementation of a trust chain. author: Samuel Schlesinger maintainer: sgschlesinger@gmail.com-extra-source-files: CHANGELOG.md+extra-source-files: CHANGELOG.md, README.md source-repository head type: git