| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Unison.Auth.PersonalKey
Synopsis
- data PersonalPrivateKey
- encodePrivateKey :: PersonalPrivateKey -> Value
- data PersonalPublicKey
- publicKey :: PersonalPrivateKey -> PersonalPublicKey
- generatePersonalKey :: MonadIO m => m PersonalPrivateKey
- personalKeyThumbprint :: PersonalPrivateKey -> KeyThumbprint
- signWithPersonalKey :: MonadIO m => PersonalPrivateKey -> ByteString -> m (Either Error PersonalKeySignature)
- verifyWithPersonalKey :: MonadIO m => PersonalPublicKey -> ByteString -> PersonalKeySignature -> m Bool
- newtype PersonalKeySignature = PersonalKeySignature {}
Documentation
data PersonalPrivateKey Source #
A JWK representing a personal key
Instances
| FromJSON PersonalPrivateKey Source # | |
Defined in Unison.Auth.PersonalKey Methods parseJSON :: Value -> Parser PersonalPrivateKey # parseJSONList :: Value -> Parser [PersonalPrivateKey] # | |
| Eq PersonalPrivateKey Source # | |
Defined in Unison.Auth.PersonalKey Methods (==) :: PersonalPrivateKey -> PersonalPrivateKey -> Bool # (/=) :: PersonalPrivateKey -> PersonalPrivateKey -> Bool # | |
encodePrivateKey :: PersonalPrivateKey -> Value Source #
Encode the private JWK.
I left off a ToJSON instance because I want to be explicit about when we're encoding the private key.
data PersonalPublicKey Source #
Instances
| ToJSON PersonalPublicKey Source # | |
Defined in Unison.Auth.PersonalKey Methods toJSON :: PersonalPublicKey -> Value # toEncoding :: PersonalPublicKey -> Encoding # toJSONList :: [PersonalPublicKey] -> Value # toEncodingList :: [PersonalPublicKey] -> Encoding # | |
generatePersonalKey :: MonadIO m => m PersonalPrivateKey Source #
signWithPersonalKey :: MonadIO m => PersonalPrivateKey -> ByteString -> m (Either Error PersonalKeySignature) Source #
Sign arbitrary bytes using a personal private key
>>>key <- generatePersonalKey>>>let msg = "Hello, world!">>>signature <- fromRight (error "failed to sign") <$> signWithPersonalKey key msg>>>verifyWithPersonalKey (publicKey key) msg signatureTrue
verifyWithPersonalKey :: MonadIO m => PersonalPublicKey -> ByteString -> PersonalKeySignature -> m Bool Source #
Verify a signature made with a personal private key
newtype PersonalKeySignature Source #
Constructors
| PersonalKeySignature | |
Fields | |
Instances
| Show PersonalKeySignature Source # | |
Defined in Unison.Auth.PersonalKey Methods showsPrec :: Int -> PersonalKeySignature -> ShowS # show :: PersonalKeySignature -> String # showList :: [PersonalKeySignature] -> ShowS # | |
| Eq PersonalKeySignature Source # | |
Defined in Unison.Auth.PersonalKey Methods (==) :: PersonalKeySignature -> PersonalKeySignature -> Bool # (/=) :: PersonalKeySignature -> PersonalKeySignature -> Bool # | |