| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Web.WebPush.Internal
Synopsis
- data ServerIdentification = ServerIdentification {}
- webPushJWT :: MonadRandom m => PrivateKey -> ServerIdentification -> m ByteString
- data WebPushEncryptionInput = EncryptionInput {
- applicationServerPrivateKey :: PrivateNumber
- userAgentPublicKeyBytes :: ByteString
- authenticationSecret :: ByteString
- salt :: ByteString
- plainText :: ByteString
- paddingLength :: Int64
- data WebPushEncryptionOutput = EncryptionOutput {}
- data EncryptError
- = EncodeApplicationPublicKeyError String
- | EncryptCipherInitError CryptoError
- | EncryptAeadInitError CryptoError
- | EncryptInputPublicKeyError CryptoError
- | EncryptInputApplicationPublicKeyError String
- webPushEncrypt :: WebPushEncryptionInput -> Either EncryptError WebPushEncryptionOutput
- hostHeaders :: (MonadIO m, MonadRandom m) => PrivateKey -> ServerIdentification -> m [Header]
- uriHost :: URI -> Maybe Text
- ecPublicKeyToBytes :: Point -> Either String ByteString
- ecPublicKeyToBytes' :: (Integer, Integer) -> ByteString
- ecBytesToPublicKey :: ByteString -> Either CryptoError Point
- type Bytes32 = (Word64, Word64, Word64, Word64)
- int32Bytes :: Integer -> Bytes32
- bytes32Int :: Bytes32 -> Integer
Documentation
data ServerIdentification Source #
Server identification for a single host, used to identify the server to the remote push server
Constructors
| ServerIdentification | |
Fields
| |
Instances
| ToJSON ServerIdentification Source # | |
Defined in Web.WebPush.Internal Methods toJSON :: ServerIdentification -> Value toEncoding :: ServerIdentification -> Encoding toJSONList :: [ServerIdentification] -> Value toEncodingList :: [ServerIdentification] -> Encoding | |
| Show ServerIdentification Source # | |
Defined in Web.WebPush.Internal | |
webPushJWT :: MonadRandom m => PrivateKey -> ServerIdentification -> m ByteString Source #
data WebPushEncryptionInput Source #
All inputs are in raw bytes with no encoding except for the plaintext for which raw bytes are the Base 64 encoded bytes
Constructors
| EncryptionInput | |
Fields
| |
Instances
| Show WebPushEncryptionInput Source # | |
Defined in Web.WebPush.Internal | |
data WebPushEncryptionOutput Source #
Intermediate encryption output used in tests All in raw bytes
data EncryptError Source #
Constructors
| EncodeApplicationPublicKeyError String | |
| EncryptCipherInitError CryptoError | |
| EncryptAeadInitError CryptoError | |
| EncryptInputPublicKeyError CryptoError | |
| EncryptInputApplicationPublicKeyError String |
Instances
| Show EncryptError Source # | |
Defined in Web.WebPush.Internal | |
| Eq EncryptError Source # | |
Defined in Web.WebPush.Internal Methods (==) :: EncryptError -> EncryptError -> Bool Source # (/=) :: EncryptError -> EncryptError -> Bool Source # | |
webPushEncrypt :: WebPushEncryptionInput -> Either EncryptError WebPushEncryptionOutput Source #
Payload encryption https://tools.ietf.org/html/draft-ietf-webpush-encryption-04
hostHeaders :: (MonadIO m, MonadRandom m) => PrivateKey -> ServerIdentification -> m [Header] Source #
Authorization header for a vapid push notification request this is shared between all push notifications sent to a single push service host
ecPublicKeyToBytes :: Point -> Either String ByteString Source #
ecPublicKeyToBytes' :: (Integer, Integer) -> ByteString Source #
ecBytesToPublicKey :: ByteString -> Either CryptoError Point Source #
int32Bytes :: Integer -> Bytes32 Source #
bytes32Int :: Bytes32 -> Integer Source #