Safe Haskell | None |
---|---|
Language | Haskell98 |
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. This module also defines a JSON Web Key Set (JWK Set) JSON data structure for representing a set of JWKs.
- data JWK = JWK KeyMaterial (Maybe KeyUse) (Maybe [KeyOp]) (Maybe Alg) (Maybe String) (Maybe URI) (Maybe (NonEmpty Base64X509)) (Maybe Base64SHA1) (Maybe Base64SHA256)
- jwkMaterial :: Lens' JWK KeyMaterial
- jwkUse :: Lens' JWK (Maybe KeyUse)
- jwkKeyOps :: Lens' JWK (Maybe [KeyOp])
- jwkAlg :: Lens' JWK (Maybe Alg)
- jwkKid :: Lens' JWK (Maybe String)
- jwkX5u :: Lens' JWK (Maybe URI)
- jwkX5c :: Lens' JWK (Maybe (NonEmpty Base64X509))
- jwkX5t :: Lens' JWK (Maybe Base64SHA1)
- jwkX5tS256 :: Lens' JWK (Maybe Base64SHA256)
- fromKeyMaterial :: KeyMaterial -> JWK
- genJWK :: MonadRandom m => KeyMaterialGenParam -> m JWK
- newtype JWKSet = JWKSet [JWK]
- class AsPublicKey k where
- data EC = EC
- data RSA = RSA
- data Oct = Oct
- data Crv
- data ECKeyParameters = ECKeyParameters {
- ecKty :: EC
- ecCrv :: Crv
- ecX :: SizedBase64Integer
- ecY :: SizedBase64Integer
- ecD :: Maybe SizedBase64Integer
- data RSAPrivateKeyOthElem = RSAPrivateKeyOthElem {}
- data RSAPrivateKeyOptionalParameters = RSAPrivateKeyOptionalParameters {}
- data RSAPrivateKeyParameters = RSAPrivateKeyParameters {}
- data RSAKeyParameters = RSAKeyParameters RSA SizedBase64Integer Base64Integer (Maybe RSAPrivateKeyParameters)
- rsaE :: Lens' RSAKeyParameters Base64Integer
- rsaKty :: Lens' RSAKeyParameters RSA
- rsaN :: Lens' RSAKeyParameters SizedBase64Integer
- rsaPrivateKeyParameters :: Lens' RSAKeyParameters (Maybe RSAPrivateKeyParameters)
- rsaPublicKey :: RSAKeyParameters -> PublicKey
- genRSA :: MonadRandom m => Int -> m RSAKeyParameters
- data OctKeyParameters = OctKeyParameters {
- octKty :: Oct
- octK :: Base64Octets
- data KeyMaterialGenParam
- data KeyMaterial
- genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial
- sign :: MonadRandom m => Alg -> KeyMaterial -> ByteString -> m (Either Error ByteString)
- verify :: Alg -> KeyMaterial -> ByteString -> ByteString -> Either Error Bool
- module Crypto.Random
Documentation
JWK §3. JSON Web Key (JWK) Format
JWK KeyMaterial (Maybe KeyUse) (Maybe [KeyOp]) (Maybe Alg) (Maybe String) (Maybe URI) (Maybe (NonEmpty Base64X509)) (Maybe Base64SHA1) (Maybe Base64SHA256) |
jwkX5tS256 :: Lens' JWK (Maybe Base64SHA256) Source #
fromKeyMaterial :: KeyMaterial -> JWK Source #
genJWK :: MonadRandom m => KeyMaterialGenParam -> m JWK Source #
JWK §4. JSON Web Key Set (JWK Set) Format
Type classes
class AsPublicKey k where Source #
asPublicKey :: Prism' k k Source #
"kty" (Key Type) Parameter Values
Elliptic Curve key type (Recommeded+)
RSA key type (Required)
Octet sequence (symmetric key) key type (Required)
Parameters for Elliptic Curve Keys
"crv" (Curve) Parameter
data ECKeyParameters Source #
Parameters for Elliptic Curve Keys
ECKeyParameters | |
|
Parameters for RSA Keys
data RSAPrivateKeyOthElem Source #
"oth" (Other Primes Info) Parameter
data RSAPrivateKeyOptionalParameters Source #
Optional parameters for RSA private keys
data RSAKeyParameters Source #
Parameters for RSA Keys
genRSA :: MonadRandom m => Int -> m RSAKeyParameters Source #
Parameters for Symmetric Keys
data OctKeyParameters Source #
Symmetric key parameters data.
data KeyMaterial Source #
Key material sum type.
genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial Source #
sign :: MonadRandom m => Alg -> KeyMaterial -> ByteString -> m (Either Error ByteString) Source #
verify :: Alg -> KeyMaterial -> ByteString -> ByteString -> Either Error Bool Source #
module Crypto.Random