Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- ecParametersFromX509 :: PubKeyEC -> Maybe ECKeyParameters
- 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 Source #
Keys that may have have public material
Instances
AsPublicKey RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter RSAKeyParameters (Maybe RSAKeyParameters) Source # | |
AsPublicKey ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter ECKeyParameters (Maybe ECKeyParameters) Source # | |
AsPublicKey KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter KeyMaterial (Maybe KeyMaterial) Source # | |
AsPublicKey OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter OKPKeyParameters (Maybe OKPKeyParameters) Source # | |
AsPublicKey JWK Source # | |
Defined in Crypto.JOSE.JWK |
Parameters for Elliptic Curve Keys
"crv" (Curve) Parameter
data ECKeyParameters Source #
Parameters for Elliptic Curve Keys
Instances
Eq ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: ECKeyParameters -> ECKeyParameters -> Bool # (/=) :: ECKeyParameters -> ECKeyParameters -> Bool # | |
Show ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> ECKeyParameters -> ShowS # show :: ECKeyParameters -> String # showList :: [ECKeyParameters] -> ShowS # | |
Arbitrary ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
ToJSON ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: ECKeyParameters -> Value # toEncoding :: ECKeyParameters -> Encoding # toJSONList :: [ECKeyParameters] -> Value # toEncodingList :: [ECKeyParameters] -> Encoding # | |
FromJSON ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser ECKeyParameters # parseJSONList :: Value -> Parser [ECKeyParameters] # | |
AsPublicKey ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter ECKeyParameters (Maybe ECKeyParameters) Source # |
point :: ECKeyParameters -> Point Source #
ecPrivateKey :: (MonadError e m, AsError e) => ECKeyParameters -> m Integer Source #
Parameters for RSA Keys
data RSAPrivateKeyOthElem Source #
"oth" (Other Primes Info) Parameter
Constructors
RSAPrivateKeyOthElem | |
Fields
|
Instances
Eq RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: RSAPrivateKeyOthElem -> RSAPrivateKeyOthElem -> Bool # (/=) :: RSAPrivateKeyOthElem -> RSAPrivateKeyOthElem -> Bool # | |
Show RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> RSAPrivateKeyOthElem -> ShowS # show :: RSAPrivateKeyOthElem -> String # showList :: [RSAPrivateKeyOthElem] -> ShowS # | |
Arbitrary RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods | |
ToJSON RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: RSAPrivateKeyOthElem -> Value # toEncoding :: RSAPrivateKeyOthElem -> Encoding # toJSONList :: [RSAPrivateKeyOthElem] -> Value # toEncodingList :: [RSAPrivateKeyOthElem] -> Encoding # | |
FromJSON RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAPrivateKeyOthElem # parseJSONList :: Value -> Parser [RSAPrivateKeyOthElem] # |
data RSAPrivateKeyOptionalParameters Source #
Optional parameters for RSA private keys
Constructors
RSAPrivateKeyOptionalParameters | |
Fields
|
Instances
Eq RSAPrivateKeyOptionalParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
Show RSAPrivateKeyOptionalParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> RSAPrivateKeyOptionalParameters -> ShowS # | |
Arbitrary RSAPrivateKeyOptionalParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
ToJSON RSAPrivateKeyOptionalParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
FromJSON RSAPrivateKeyOptionalParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAPrivateKeyOptionalParameters # parseJSONList :: Value -> Parser [RSAPrivateKeyOptionalParameters] # |
data RSAPrivateKeyParameters Source #
RSA private key parameters
Constructors
RSAPrivateKeyParameters | |
Instances
data RSAKeyParameters Source #
Parameters for RSA Keys
Constructors
RSAKeyParameters Base64Integer Base64Integer (Maybe RSAPrivateKeyParameters) |
Instances
genRSA :: MonadRandom m => Int -> m RSAKeyParameters Source #
Parameters for Symmetric Keys
newtype OctKeyParameters Source #
Symmetric key parameters data.
Constructors
OctKeyParameters Base64Octets |
Instances
Eq OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: OctKeyParameters -> OctKeyParameters -> Bool # (/=) :: OctKeyParameters -> OctKeyParameters -> Bool # | |
Show OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> OctKeyParameters -> ShowS # show :: OctKeyParameters -> String # showList :: [OctKeyParameters] -> ShowS # | |
Arbitrary OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
ToJSON OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: OctKeyParameters -> Value # toEncoding :: OctKeyParameters -> Encoding # toJSONList :: [OctKeyParameters] -> Value # toEncodingList :: [OctKeyParameters] -> Encoding # | |
FromJSON OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser OctKeyParameters # parseJSONList :: Value -> Parser [OctKeyParameters] # |
Parameters for CFRG EC keys (RFC 8037)
data OKPKeyParameters Source #
Instances
Key generation
data KeyMaterialGenParam Source #
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 Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: KeyMaterialGenParam -> KeyMaterialGenParam -> Bool # (/=) :: KeyMaterialGenParam -> KeyMaterialGenParam -> Bool # | |
Show KeyMaterialGenParam Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> KeyMaterialGenParam -> ShowS # show :: KeyMaterialGenParam -> String # showList :: [KeyMaterialGenParam] -> ShowS # | |
Arbitrary KeyMaterialGenParam Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods |
data KeyMaterial Source #
Key material sum type.
Constructors
ECKeyMaterial ECKeyParameters | |
RSAKeyMaterial RSAKeyParameters | |
OctKeyMaterial OctKeyParameters | |
OKPKeyMaterial OKPKeyParameters |
Instances
Eq KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
Show KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> KeyMaterial -> ShowS # show :: KeyMaterial -> String # showList :: [KeyMaterial] -> ShowS # | |
Arbitrary KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
ToJSON KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: KeyMaterial -> Value # toEncoding :: KeyMaterial -> Encoding # toJSONList :: [KeyMaterial] -> Value # toEncodingList :: [KeyMaterial] -> Encoding # | |
FromJSON KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
AsPublicKey KeyMaterial Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter KeyMaterial (Maybe KeyMaterial) Source # |
genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial Source #
Signing and verification
sign :: (MonadRandom m, MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> m ByteString Source #
verify :: (MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> ByteString -> m Bool Source #
module Crypto.Random