| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Crypto.JOSE.JWA.JWK
Contents
Description
Cryptographic Algorithms for Keys.
Synopsis
- class AsPublicKey k where
- asPublicKey :: Getter k (Maybe k)
- data Crv
- data ECKeyParameters
- ecCrv :: Getter ECKeyParameters Crv
- ecX :: Getter ECKeyParameters SizedBase64Integer
- ecY :: Getter ECKeyParameters SizedBase64Integer
- ecD :: Getter ECKeyParameters (Maybe SizedBase64Integer)
- curve :: Crv -> Curve
- point :: ECKeyParameters -> Point
- ecPrivateKey :: (MonadError e m, AsError e) => ECKeyParameters -> m Integer
- data RSAPrivateKeyOthElem = RSAPrivateKeyOthElem {}
- data RSAPrivateKeyOptionalParameters = RSAPrivateKeyOptionalParameters {}
- data RSAPrivateKeyParameters = RSAPrivateKeyParameters {}
- data RSAKeyParameters = RSAKeyParameters Base64Integer Base64Integer (Maybe RSAPrivateKeyParameters)
- toRSAKeyParameters :: PrivateKey -> RSAKeyParameters
- toRSAPublicKeyParameters :: PublicKey -> RSAKeyParameters
- rsaE :: Lens' RSAKeyParameters Base64Integer
- rsaN :: Lens' RSAKeyParameters Base64Integer
- rsaPrivateKeyParameters :: Lens' RSAKeyParameters (Maybe RSAPrivateKeyParameters)
- rsaPublicKey :: RSAKeyParameters -> PublicKey
- genRSA :: MonadRandom m => Int -> m RSAKeyParameters
- newtype OctKeyParameters = OctKeyParameters Base64Octets
- octK :: Iso' OctKeyParameters Base64Octets
- data OKPKeyParameters
- data OKPCrv
- data KeyMaterialGenParam
- data KeyMaterial
- genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial
- sign :: (MonadRandom m, MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> m ByteString
- verify :: (MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> ByteString -> m Bool
- module Crypto.Random
Type classes
class AsPublicKey k where #
Keys that may have have public material
Instances
| AsPublicKey RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter RSAKeyParameters (Maybe RSAKeyParameters) # | |
| AsPublicKey ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter ECKeyParameters (Maybe ECKeyParameters) # | |
| AsPublicKey KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK Methods | |
| AsPublicKey OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter OKPKeyParameters (Maybe OKPKeyParameters) # | |
| AsPublicKey JWK # | |
Defined in Crypto.JOSE.JWK | |
Parameters for Elliptic Curve Keys
"crv" (Curve) Parameter
data ECKeyParameters #
Parameters for Elliptic Curve Keys
Instances
| Eq ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: ECKeyParameters -> ECKeyParameters -> Bool # (/=) :: ECKeyParameters -> ECKeyParameters -> Bool # | |
| Show ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> ECKeyParameters -> ShowS # show :: ECKeyParameters -> String # showList :: [ECKeyParameters] -> ShowS # | |
| Arbitrary ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| ToJSON ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: ECKeyParameters -> Value # toEncoding :: ECKeyParameters -> Encoding # toJSONList :: [ECKeyParameters] -> Value # toEncodingList :: [ECKeyParameters] -> Encoding # | |
| FromJSON ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser ECKeyParameters # parseJSONList :: Value -> Parser [ECKeyParameters] # | |
| AsPublicKey ECKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter ECKeyParameters (Maybe ECKeyParameters) # | |
point :: ECKeyParameters -> Point #
ecPrivateKey :: (MonadError e m, AsError e) => ECKeyParameters -> m Integer #
Parameters for RSA Keys
data RSAPrivateKeyOthElem #
"oth" (Other Primes Info) Parameter
Constructors
| RSAPrivateKeyOthElem | |
Fields
| |
Instances
| Eq RSAPrivateKeyOthElem # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: RSAPrivateKeyOthElem -> RSAPrivateKeyOthElem -> Bool # (/=) :: RSAPrivateKeyOthElem -> RSAPrivateKeyOthElem -> Bool # | |
| Show RSAPrivateKeyOthElem # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> RSAPrivateKeyOthElem -> ShowS # show :: RSAPrivateKeyOthElem -> String # showList :: [RSAPrivateKeyOthElem] -> ShowS # | |
| Arbitrary RSAPrivateKeyOthElem # | |
Defined in Crypto.JOSE.JWA.JWK Methods | |
| ToJSON RSAPrivateKeyOthElem # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: RSAPrivateKeyOthElem -> Value # toEncoding :: RSAPrivateKeyOthElem -> Encoding # toJSONList :: [RSAPrivateKeyOthElem] -> Value # toEncodingList :: [RSAPrivateKeyOthElem] -> Encoding # | |
| FromJSON RSAPrivateKeyOthElem # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAPrivateKeyOthElem # parseJSONList :: Value -> Parser [RSAPrivateKeyOthElem] # | |
data RSAPrivateKeyOptionalParameters #
Optional parameters for RSA private keys
Constructors
| RSAPrivateKeyOptionalParameters | |
Fields
| |
Instances
| Eq RSAPrivateKeyOptionalParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| Show RSAPrivateKeyOptionalParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> RSAPrivateKeyOptionalParameters -> ShowS # | |
| Arbitrary RSAPrivateKeyOptionalParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| ToJSON RSAPrivateKeyOptionalParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| FromJSON RSAPrivateKeyOptionalParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAPrivateKeyOptionalParameters # parseJSONList :: Value -> Parser [RSAPrivateKeyOptionalParameters] # | |
data RSAPrivateKeyParameters #
RSA private key parameters
Constructors
| RSAPrivateKeyParameters | |
Instances
data RSAKeyParameters #
Parameters for RSA Keys
Constructors
| RSAKeyParameters Base64Integer Base64Integer (Maybe RSAPrivateKeyParameters) |
Instances
| Eq RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: RSAKeyParameters -> RSAKeyParameters -> Bool # (/=) :: RSAKeyParameters -> RSAKeyParameters -> Bool # | |
| Show RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> RSAKeyParameters -> ShowS # show :: RSAKeyParameters -> String # showList :: [RSAKeyParameters] -> ShowS # | |
| Arbitrary RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| ToJSON RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: RSAKeyParameters -> Value # toEncoding :: RSAKeyParameters -> Encoding # toJSONList :: [RSAKeyParameters] -> Value # toEncodingList :: [RSAKeyParameters] -> Encoding # | |
| FromJSON RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAKeyParameters # parseJSONList :: Value -> Parser [RSAKeyParameters] # | |
| AsPublicKey RSAKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter RSAKeyParameters (Maybe RSAKeyParameters) # | |
genRSA :: MonadRandom m => Int -> m RSAKeyParameters #
Parameters for Symmetric Keys
newtype OctKeyParameters #
Symmetric key parameters data.
Constructors
| OctKeyParameters Base64Octets |
Instances
| Eq OctKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: OctKeyParameters -> OctKeyParameters -> Bool # (/=) :: OctKeyParameters -> OctKeyParameters -> Bool # | |
| Show OctKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> OctKeyParameters -> ShowS # show :: OctKeyParameters -> String # showList :: [OctKeyParameters] -> ShowS # | |
| Arbitrary OctKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| ToJSON OctKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: OctKeyParameters -> Value # toEncoding :: OctKeyParameters -> Encoding # toJSONList :: [OctKeyParameters] -> Value # toEncodingList :: [OctKeyParameters] -> Encoding # | |
| FromJSON OctKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser OctKeyParameters # parseJSONList :: Value -> Parser [OctKeyParameters] # | |
Parameters for CFRG EC keys (RFC 8037)
data OKPKeyParameters #
Instances
| Eq OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: OKPKeyParameters -> OKPKeyParameters -> Bool # (/=) :: OKPKeyParameters -> OKPKeyParameters -> Bool # | |
| Show OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> OKPKeyParameters -> ShowS # show :: OKPKeyParameters -> String # showList :: [OKPKeyParameters] -> ShowS # | |
| Arbitrary OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK | |
| ToJSON OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: OKPKeyParameters -> Value # toEncoding :: OKPKeyParameters -> Encoding # toJSONList :: [OKPKeyParameters] -> Value # toEncodingList :: [OKPKeyParameters] -> Encoding # | |
| FromJSON OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser OKPKeyParameters # parseJSONList :: Value -> Parser [OKPKeyParameters] # | |
| AsPublicKey OKPKeyParameters # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter OKPKeyParameters (Maybe OKPKeyParameters) # | |
Key generation
data KeyMaterialGenParam #
Keygen parameters.
Constructors
| ECGenParam Crv | Generate an EC key with specified curve. |
| RSAGenParam Int | Generate an RSA key with specified size in bytes. |
| OctGenParam Int | Generate a symmetric key with specified size in bytes. |
| OKPGenParam OKPCrv | Generate an EdDSA or Edwards ECDH key with specified curve. |
Instances
| Eq KeyMaterialGenParam # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: KeyMaterialGenParam -> KeyMaterialGenParam -> Bool # (/=) :: KeyMaterialGenParam -> KeyMaterialGenParam -> Bool # | |
| Show KeyMaterialGenParam # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> KeyMaterialGenParam -> ShowS # show :: KeyMaterialGenParam -> String # showList :: [KeyMaterialGenParam] -> ShowS # | |
| Arbitrary KeyMaterialGenParam # | |
Defined in Crypto.JOSE.JWA.JWK Methods | |
data KeyMaterial #
Key material sum type.
Constructors
| ECKeyMaterial ECKeyParameters | |
| RSAKeyMaterial RSAKeyParameters | |
| OctKeyMaterial OctKeyParameters | |
| OKPKeyMaterial OKPKeyParameters |
Instances
| Eq KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK | |
| Show KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> KeyMaterial -> ShowS # show :: KeyMaterial -> String # showList :: [KeyMaterial] -> ShowS # | |
| Arbitrary KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK | |
| ToJSON KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: KeyMaterial -> Value # toEncoding :: KeyMaterial -> Encoding # toJSONList :: [KeyMaterial] -> Value # toEncodingList :: [KeyMaterial] -> Encoding # | |
| FromJSON KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK | |
| AsPublicKey KeyMaterial # | |
Defined in Crypto.JOSE.JWA.JWK Methods | |
genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial #
Signing and verification
sign :: (MonadRandom m, MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> m ByteString #
verify :: (MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> ByteString -> m Bool #
module Crypto.Random