| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Crypto.JOSE.JWA.JWK
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 {
- rsaP :: Base64Integer
- rsaQ :: Base64Integer
- rsaDp :: Base64Integer
- rsaDq :: Base64Integer
- rsaQi :: Base64Integer
- rsaOth :: Maybe (NonEmpty RSAPrivateKeyOthElem)
- 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
- = Ed25519Key PublicKey (Maybe SecretKey)
- | X25519Key PublicKey (Maybe SecretKey)
- data OKPCrv
- data KeyMaterialGenParam
- = ECGenParam Crv
- | RSAGenParam Int
- | OctGenParam Int
- | OKPGenParam OKPCrv
- 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
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 Methods asPublicKey :: Getter JWK (Maybe JWK) Source # | |
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 | |
| FromJSON ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser ECKeyParameters parseJSONList :: Value -> Parser [ECKeyParameters] | |
| ToJSON ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: ECKeyParameters -> Value toEncoding :: ECKeyParameters -> Encoding toJSONList :: [ECKeyParameters] -> Value toEncodingList :: [ECKeyParameters] -> Encoding | |
| Arbitrary ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
| AsPublicKey ECKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter ECKeyParameters (Maybe ECKeyParameters) Source # | |
ecCrv :: Getter ECKeyParameters Crv Source #
ecX :: Getter ECKeyParameters SizedBase64Integer Source #
ecY :: Getter ECKeyParameters SizedBase64Integer Source #
ecD :: Getter ECKeyParameters (Maybe SizedBase64Integer) Source #
point :: ECKeyParameters -> Point Source #
ecPrivateKey :: (MonadError e m, AsError e) => ECKeyParameters -> m Integer Source #
ecParametersFromX509 :: PubKeyEC -> Maybe ECKeyParameters 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 | |
| FromJSON RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAPrivateKeyOthElem parseJSONList :: Value -> Parser [RSAPrivateKeyOthElem] | |
| ToJSON RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: RSAPrivateKeyOthElem -> Value toEncoding :: RSAPrivateKeyOthElem -> Encoding toJSONList :: [RSAPrivateKeyOthElem] -> Value toEncodingList :: [RSAPrivateKeyOthElem] -> Encoding | |
| Arbitrary RSAPrivateKeyOthElem Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods arbitrary :: Gen RSAPrivateKeyOthElem | |
data RSAPrivateKeyOptionalParameters Source #
Optional parameters for RSA private keys
Constructors
| RSAPrivateKeyOptionalParameters | |
Fields
| |
Instances
data RSAPrivateKeyParameters Source #
RSA private key parameters
Constructors
| RSAPrivateKeyParameters | |
Fields | |
Instances
data RSAKeyParameters Source #
Parameters for RSA Keys
Constructors
| RSAKeyParameters Base64Integer Base64Integer (Maybe RSAPrivateKeyParameters) |
Instances
| Eq RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: RSAKeyParameters -> RSAKeyParameters -> Bool (/=) :: RSAKeyParameters -> RSAKeyParameters -> Bool | |
| Show RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> RSAKeyParameters -> ShowS show :: RSAKeyParameters -> String showList :: [RSAKeyParameters] -> ShowS | |
| FromJSON RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser RSAKeyParameters parseJSONList :: Value -> Parser [RSAKeyParameters] | |
| ToJSON RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: RSAKeyParameters -> Value toEncoding :: RSAKeyParameters -> Encoding toJSONList :: [RSAKeyParameters] -> Value toEncodingList :: [RSAKeyParameters] -> Encoding | |
| Arbitrary RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
| AsPublicKey RSAKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter RSAKeyParameters (Maybe RSAKeyParameters) Source # | |
toRSAKeyParameters :: PrivateKey -> RSAKeyParameters Source #
toRSAPublicKeyParameters :: PublicKey -> RSAKeyParameters Source #
rsaE :: Lens' RSAKeyParameters Base64Integer Source #
rsaN :: Lens' RSAKeyParameters Base64Integer Source #
rsaPrivateKeyParameters :: Lens' RSAKeyParameters (Maybe RSAPrivateKeyParameters) Source #
rsaPublicKey :: RSAKeyParameters -> PublicKey Source #
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 | |
| FromJSON OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser OctKeyParameters parseJSONList :: Value -> Parser [OctKeyParameters] | |
| ToJSON OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: OctKeyParameters -> Value toEncoding :: OctKeyParameters -> Encoding toJSONList :: [OctKeyParameters] -> Value toEncodingList :: [OctKeyParameters] -> Encoding | |
| Arbitrary OctKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
octK :: Iso' OctKeyParameters Base64Octets Source #
Parameters for CFRG EC keys (RFC 8037)
data OKPKeyParameters Source #
Constructors
| Ed25519Key PublicKey (Maybe SecretKey) | |
| X25519Key PublicKey (Maybe SecretKey) |
Instances
| Eq OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods (==) :: OKPKeyParameters -> OKPKeyParameters -> Bool (/=) :: OKPKeyParameters -> OKPKeyParameters -> Bool | |
| Show OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods showsPrec :: Int -> OKPKeyParameters -> ShowS show :: OKPKeyParameters -> String showList :: [OKPKeyParameters] -> ShowS | |
| FromJSON OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods parseJSON :: Value -> Parser OKPKeyParameters parseJSONList :: Value -> Parser [OKPKeyParameters] | |
| ToJSON OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods toJSON :: OKPKeyParameters -> Value toEncoding :: OKPKeyParameters -> Encoding toJSONList :: [OKPKeyParameters] -> Value toEncodingList :: [OKPKeyParameters] -> Encoding | |
| Arbitrary OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK | |
| AsPublicKey OKPKeyParameters Source # | |
Defined in Crypto.JOSE.JWA.JWK Methods asPublicKey :: Getter OKPKeyParameters (Maybe OKPKeyParameters) Source # | |
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 | |
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 | |
| FromJSON 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 | |
| Arbitrary 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 #