Safe Haskell | None |
---|---|
Language | Haskell2010 |
Nats.Nkeys.Codec
Synopsis
- data KeyPrefix
- encode :: KeyPrefix -> ByteString -> ByteString
- encodeSeed :: KeyPrefix -> ByteString -> ByteString
- fromByte :: Word8 -> KeyPrefix
- toByte :: KeyPrefix -> Word8
- decode :: ByteString -> Either Text ByteString
- extractSeedPrefix :: ByteString -> KeyPrefix
- extractCrc :: ByteString -> Word16
Documentation
Represents the well-known prefixes available for NATS-encoded keys
Constructors
Seed | (S) Precedes all seed keys, followed by a type prefix |
Private | (P) Used for private keys |
Server | (N) Servers and their ilk (nodes, processes, etc) |
Cluster | (C) Clusters |
Operator | (O) Operators |
Account | (A) Accounts |
User | (U) Users |
Curve | (X) Curve keys used for encryption/decryption |
Unknown | (Z) Catch-all for unknown prefixes |
Instances
Data KeyPrefix Source # | |
Defined in Nats.Nkeys.Codec Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeyPrefix -> c KeyPrefix # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KeyPrefix # toConstr :: KeyPrefix -> Constr # dataTypeOf :: KeyPrefix -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KeyPrefix) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyPrefix) # gmapT :: (forall b. Data b => b -> b) -> KeyPrefix -> KeyPrefix # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeyPrefix -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeyPrefix -> r # gmapQ :: (forall d. Data d => d -> u) -> KeyPrefix -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyPrefix -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeyPrefix -> m KeyPrefix # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyPrefix -> m KeyPrefix # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyPrefix -> m KeyPrefix # | |
Show KeyPrefix Source # | |
Eq KeyPrefix Source # | |
encode :: KeyPrefix -> ByteString -> ByteString Source #
encodeSeed :: KeyPrefix -> ByteString -> ByteString Source #
decode :: ByteString -> Either Text ByteString Source #
extractCrc :: ByteString -> Word16 Source #