HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulecrypton-x509-1.9.2Haskell2010

Data.X509

Read/Write X509 Certificate, CRL and their signed equivalents.

Follows RFC5280 / RFC6818

Contents
  1. Types
  2. Certificate Revocation List (CRL)
  3. Naming
  4. Certificate Chain
  5. Signed types and marshalling
  6. Parametrized Signed accessor
  7. Hash distinguished names related function
Synopsis

Types

datadata Certificate

X.509 Certificate type.

This type doesn't include the signature, it's describe in the RFC as tbsCertificate.

Constructors

Instances3Eq, Show, ASN1Object
datadata PubKey

Public key types known and used in X.509

Constructors

Instances3Eq, Show, ASN1Object
  • Eq PubKeyDefined in crypton-x509-1.9.2 · Data.X509.PublicKey
  • Show PubKeyDefined in crypton-x509-1.9.2 · Data.X509.PublicKey
  • ASN1Object PubKeyDefined in crypton-x509-1.9.2 · Data.X509.PublicKey
datadata PubKeyEC
Instances2Eq, Show
  • Eq PubKeyECDefined in crypton-x509-1.9.2 · Data.X509.PublicKey
  • Show PubKeyECDefined in crypton-x509-1.9.2 · Data.X509.PublicKey
datadata PrivKey

Private key types known and used in X.509

Constructors

Instances4Eq, Show, DebugShow, ASN1Object
  • Eq PrivKeyDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey
  • Show PrivKeyDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey
  • DebugShow PrivKeyDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey

    Rendering a private key with the key material in it, for the times when that is what is meant. Each arm is crypton's own debugShow for that key type, except the EC one, which is this module's.

  • ASN1Object PrivKeyDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey
datadata PrivKeyEC
Instances3Eq, Show, DebugShow
  • Eq PrivKeyECDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey
  • Show PrivKeyECDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey

    The curve is shown; privkeyEC_priv is not. Use debugShow to see it.

  • DebugShow PrivKeyECDefined in crypton-x509-1.9.2 · Data.X509.PrivateKey
datadata PubKeyALG

Public Key Algorithm

Constructors

Instances3Eq, Show, OIDable
  • Eq PubKeyALGDefined in crypton-x509-1.9.2 · Data.X509.AlgorithmIdentifier
  • Show PubKeyALGDefined in crypton-x509-1.9.2 · Data.X509.AlgorithmIdentifier
  • OIDable PubKeyALGDefined in crypton-x509-1.9.2 · Data.X509.AlgorithmIdentifier
datadata SignatureALG

Signature Algorithm, often composed of a public key algorithm and a hash algorithm. For some signature algorithms the hash algorithm is intrinsic to the public key algorithm and is not needed in the data type.

Instances3Eq, Show, ASN1Object

Try to decode an ExtensionRaw.

If this function return: * Nothing, the OID doesn't match * Just Left, the OID matched, but the extension couldn't be decoded * Just Right, the OID matched, and the extension has been succesfully decoded

datadata AltName

Different naming scheme use by the extension.

Not all name types are available, missing: otherName x400Address ediPartyName registeredID

Instances3Eq, Ord, Show
  • Eq AltNameDefined in crypton-x509-1.9.2 · Data.X509.Ext
  • Ord AltNameDefined in crypton-x509-1.9.2 · Data.X509.Ext
  • Show AltNameDefined in crypton-x509-1.9.2 · Data.X509.Ext
Instances4Enum, Eq, Ord, Show
Instances3Eq, Ord, Show
classclass Extension a where

Extension class.

each extension have a unique OID associated, and a way to encode and decode an ASN1 stream.

Errata: turns out, the content is not necessarily ASN1, it could be data that is only parsable by the extension e.g. raw ascii string. Add method to parse and encode with ByteString

Instances9Extension, …
datadata ReasonFlag
Instances4Enum, Eq, Ord, Show

Certificate Revocation List (CRL)

Naming

newtypenewtype DistinguishedName

A list of OID and strings.

Instances6Eq, Ord, Show, Semigroup, Monoid, ASN1Object
Instances4Eq, Ord, Show, IsString

Certificate Chain

Signed types and marshalling

datadata (Show a, Eq a, ASN1Object a) => Signed a

Represent a signed object using a traditional X509 structure.

When dealing with external certificate, use the SignedExact structure not this one.

Constructors

Instances2Eq, Show

Parametrized Signed accessor

Hash distinguished names related function

Make an OpenSSL style hash of distinguished name

OpenSSL algorithm is odd, and has been replicated here somewhat. only lower the case of ascii character.