crypton-x509-1.11.0: X509 reader and writer
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Data.X509

Description

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

Follows RFC5280 / RFC6818

Synopsis

Types

type SignedCertificate = SignedExact Certificate Source #

A Signed Certificate

type SignedCRL = SignedExact CRL Source #

A Signed CRL

data Certificate Source #

X.509 Certificate type.

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

Constructors

Certificate 

Fields

Instances

Instances details
Show Certificate Source # 
Instance details

Defined in Data.X509.Cert

ASN1Object Certificate Source # 
Instance details

Defined in Data.X509.Cert

Eq Certificate Source # 
Instance details

Defined in Data.X509.Cert

data PubKey Source #

Public key types known and used in X.509

Constructors

PubKeyRSA PublicKey

RSA public key

PubKeyRSAPSS PublicKey (Maybe PSSParams)

RSASSA-PSS public key, restricted to the parameters if any

PubKeyDSA PublicKey

DSA public key

PubKeyDH PubKeyDH

X9.42 DH public key

PubKeyEC PubKeyEC

EC public key

PubKeyX25519 PublicKey

X25519 public key

PubKeyX448 PublicKey

X448 public key

PubKeyEd25519 PublicKey

Ed25519 public key

PubKeyEd448 PublicKey

Ed448 public key

PubKeyMLDSA44 (VerificationKey MLDSA44)

ML-DSA-44 public key

PubKeyMLDSA65 (VerificationKey MLDSA65)

ML-DSA-65 public key

PubKeyMLDSA87 (VerificationKey MLDSA87)

ML-DSA-87 public key

PubKeyMLKEM512 (EncapsulationKey MLKEM512)

ML-KEM-512 public key

PubKeyMLKEM768 (EncapsulationKey MLKEM768)

ML-KEM-768 public key

PubKeyMLKEM1024 (EncapsulationKey MLKEM1024)

ML-KEM-1024 public key

PubKeyUnknown OID ByteString

unrecognized format

Instances

Instances details
Show PubKey Source # 
Instance details

Defined in Data.X509.PublicKey

ASN1Object PubKey Source # 
Instance details

Defined in Data.X509.PublicKey

Eq PubKey Source # 
Instance details

Defined in Data.X509.PublicKey

Methods

(==) :: PubKey -> PubKey -> Bool #

(/=) :: PubKey -> PubKey -> Bool #

data PubKeyEC Source #

Elliptic Curve Public Key

TODO: missing support for binary curve.

Instances

Instances details
Show PubKeyEC Source # 
Instance details

Defined in Data.X509.PublicKey

Eq PubKeyEC Source # 
Instance details

Defined in Data.X509.PublicKey

data PubKeyDH Source #

X9.42 Diffie-Hellman public key (RFC 3279 2.3.3). The constructor is hidden; use dhPublicKey and record update syntax.

Instances

Instances details
Show PubKeyDH Source # 
Instance details

Defined in Data.X509.PublicKey

Eq PubKeyDH Source # 
Instance details

Defined in Data.X509.PublicKey

dhPublicKey :: Integer -> Integer -> Integer -> Integer -> PubKeyDH Source #

A DH public key from p, g, q and the public value, without j and validation parameters.

pubkeyDH_g :: PubKeyDH -> Integer Source #

the generator

pubkeyDH_q :: PubKeyDH -> Integer Source #

the prime factor of p-1

pubkeyDH_j :: PubKeyDH -> Maybe Integer Source #

the subgroup factor

pubkeyDH_y :: PubKeyDH -> Integer Source #

the public value

newtype SerializedPoint Source #

Serialized Elliptic Curve Point

data PrivKey Source #

Private key types known and used in X.509

Constructors

PrivKeyRSA PrivateKey

RSA private key

PrivKeyRSAPSS PrivateKey (Maybe PSSParams)

RSASSA-PSS private key, restricted to the parameters if any

PrivKeyDSA PrivateKey

DSA private key

PrivKeyEC PrivKeyEC

EC private key

PrivKeyX25519 SecretKey

X25519 private key

PrivKeyX448 SecretKey

X448 private key

PrivKeyEd25519 SecretKey

Ed25519 private key

PrivKeyEd448 SecretKey

Ed448 private key

PrivKeyMLDSA44 (PrivKeyMLDSA MLDSA44)

ML-DSA-44 private key

PrivKeyMLDSA65 (PrivKeyMLDSA MLDSA65)

ML-DSA-65 private key

PrivKeyMLDSA87 (PrivKeyMLDSA MLDSA87)

ML-DSA-87 private key

PrivKeyMLKEM512 (PrivKeyMLKEM MLKEM512)

ML-KEM-512 private key

PrivKeyMLKEM768 (PrivKeyMLKEM MLKEM768)

ML-KEM-768 private key

PrivKeyMLKEM1024 (PrivKeyMLKEM MLKEM1024)

ML-KEM-1024 private key

Instances

Instances details
Show PrivKey Source # 
Instance details

Defined in Data.X509.PrivateKey

DebugShow PrivKey Source #

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.

Instance details

Defined in Data.X509.PrivateKey

Methods

debugShow :: PrivKey -> String #

ASN1Object PrivKey Source # 
Instance details

Defined in Data.X509.PrivateKey

Eq PrivKey Source # 
Instance details

Defined in Data.X509.PrivateKey

Methods

(==) :: PrivKey -> PrivKey -> Bool #

(/=) :: PrivKey -> PrivKey -> Bool #

data PrivKeyEC Source #

Elliptic Curve Private Key

TODO: missing support for binary curve.

Instances

Instances details
Show PrivKeyEC Source #

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

Instance details

Defined in Data.X509.PrivateKey

DebugShow PrivKeyEC Source # 
Instance details

Defined in Data.X509.PrivateKey

Eq PrivKeyEC Source # 
Instance details

Defined in Data.X509.PrivateKey

data PrivKeyMLDSA p Source #

An ML-DSA private key.

RFC 9881 Section 6 writes one as the seed it was derived from, as the expanded key, or as both, and which of the three it was is part of the key here. A key read from a file is therefore written back out as the same thing it came in as, rather than as whichever form this module happens to prefer.

The expanded key is there whatever the form: a seed is expanded as it is read, so privkeyMLDSA_key always answers. The seed is not, since a key written as expandedKey does not carry one; privkeyMLDSA_seed is a Maybe for that reason, and a key whose seed was never on the wire cannot be given one back -- crypton's Crypto.PubKey.MLDSA.generateKeyPairAndSeed is where a seed that is to be kept has to be caught.

The constructors are not exported: a seed and an expanded key that do not belong together would be a key that signs with one and claims the other, so the only ways in are privkeyMLDSAFromSeed, which expands the seed itself, and privkeyMLDSAFromKey, which has no seed to disagree with.

Two keys are equal when they hold the same thing in the same form: the same key as a seed and as an expanded key are two different files, and the encoding round trip says so.

Instances

Instances details
Show (PrivKeyMLDSA p) Source #

The form is shown; neither the seed nor the key is. Use debugShow to see them.

Instance details

Defined in Data.X509.PrivateKey

DebugShow (PrivKeyMLDSA p) Source # 
Instance details

Defined in Data.X509.PrivateKey

Eq (PrivKeyMLDSA p) Source # 
Instance details

Defined in Data.X509.PrivateKey

data MLKeyForm Source #

Which of the three forms of an ML-DSA (RFC 9881 Section 6) or ML-KEM (RFC 9935 Section 6) private key a key was read as, and is written back out as.

Constructors

MLKeySeed

The seed alone, seed, which Section 6 recommends.

MLKeyExpanded

The expanded key alone, expandedKey.

MLKeyBoth

Both together, both.

Instances

Instances details
Show MLKeyForm Source # 
Instance details

Defined in Data.X509.PrivateKey

Eq MLKeyForm Source # 
Instance details

Defined in Data.X509.PrivateKey

type MLDSAKeyForm = MLKeyForm Source #

Deprecated: Use MLKeyForm

The former name of MLKeyForm.

pattern MLDSAKeySeed :: MLKeyForm Source #

Deprecated: Use MLKeySeed

The former name of MLKeySeed.

pattern MLDSAKeyExpanded :: MLKeyForm Source #

Deprecated: Use MLKeyExpanded

The former name of MLKeyExpanded.

pattern MLDSAKeyBoth :: MLKeyForm Source #

Deprecated: Use MLKeyBoth

The former name of MLKeyBoth.

privkeyMLDSAFromSeed :: (MLDSA p, ByteArrayAccess ba) => proxy p -> MLKeyForm -> ba -> CryptoFailable (PrivKeyMLDSA p) Source #

Build a key from its seed, to be written back out in the given form.

The expanded key is derived here, so it cannot fail to be the one the seed belongs to. Passing MLKeyExpanded throws the seed away, which is the way to turn a seed into a key that will be written without one.

privkeyMLDSAFromKey :: SigningKey p -> PrivKeyMLDSA p Source #

Build a key from the expanded key alone, which is what a key that was generated without keeping its seed has to be.

privkeyMLDSA_key :: PrivKeyMLDSA p -> SigningKey p Source #

The expanded key, whatever form the key is in.

privkeyMLDSA_seed :: PrivKeyMLDSA p -> Maybe ScrubbedBytes Source #

The seed, for a key that has one.

privkeyMLDSA_form :: PrivKeyMLDSA p -> MLKeyForm Source #

The form the key will be written out in.

data PrivKeyMLKEM p Source #

An ML-KEM private key, kept in the form it was read as, like PrivKeyMLDSA. The constructors are not exported.

Instances

Instances details
MLKEM p => Show (PrivKeyMLKEM p) Source #

The form is shown; neither the seed nor the key is.

Instance details

Defined in Data.X509.PrivateKey

MLKEM p => DebugShow (PrivKeyMLKEM p) Source # 
Instance details

Defined in Data.X509.PrivateKey

MLKEM p => Eq (PrivKeyMLKEM p) Source # 
Instance details

Defined in Data.X509.PrivateKey

privkeyMLKEMFromSeed :: (MLKEM p, ByteArrayAccess ba) => proxy p -> MLKeyForm -> ba -> CryptoFailable (PrivKeyMLKEM p) Source #

Build a key from its seed, to be written back out in the given form.

privkeyMLKEMFromKey :: DecapsulationKey p -> PrivKeyMLKEM p Source #

Build a key from the expanded key alone.

privkeyMLKEM_key :: PrivKeyMLKEM p -> DecapsulationKey p Source #

The expanded key, whatever form the key is in.

privkeyMLKEM_seed :: PrivKeyMLKEM p -> Maybe ScrubbedBytes Source #

The seed, for a key that has one.

privkeyMLKEM_form :: PrivKeyMLKEM p -> MLKeyForm Source #

The form the key will be written out in.

pubkeyToAlg :: PubKey -> PubKeyALG Source #

Convert a Public key to the Public Key Algorithm type

privkeyToAlg :: PrivKey -> PubKeyALG Source #

Convert a Private key to the Public Key Algorithm type

data PSSParams Source #

RSASSA-PSS parameters (RFC 4055). Only MGF1 and the trailer field 1 are supported. The constructor is hidden; use defaultPSSParams and record update syntax.

Instances

Instances details
Show PSSParams Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

Eq PSSParams Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

defaultPSSParams :: HashALG -> PSSParams Source #

The hash for both the message and MGF1, and the salt length equal to the hash length.

data HashALG Source #

Hash Algorithm

Instances

Instances details
Show HashALG Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

Eq HashALG Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

Methods

(==) :: HashALG -> HashALG -> Bool #

(/=) :: HashALG -> HashALG -> Bool #

data PubKeyALG Source #

Public Key Algorithm

Constructors

PubKeyALG_RSA

RSA Public Key algorithm

PubKeyALG_RSAPSS

RSA PSS Key algorithm (RFC 3447)

PubKeyALG_DSA

DSA Public Key algorithm

PubKeyALG_EC

ECDSA & ECDH Public Key algorithm

PubKeyALG_X25519

ECDH 25519 key agreement

PubKeyALG_X448

ECDH 448 key agreement

PubKeyALG_Ed25519

EdDSA 25519 signature algorithm

PubKeyALG_Ed448

EdDSA 448 signature algorithm

PubKeyALG_MLDSA44

ML-DSA-44 signature algorithm (RFC 9881)

PubKeyALG_MLDSA65

ML-DSA-65 signature algorithm (RFC 9881)

PubKeyALG_MLDSA87

ML-DSA-87 signature algorithm (RFC 9881)

PubKeyALG_MLKEM512

ML-KEM-512 key encapsulation (RFC 9935)

PubKeyALG_MLKEM768

ML-KEM-768 key encapsulation (RFC 9935)

PubKeyALG_MLKEM1024

ML-KEM-1024 key encapsulation (RFC 9935)

PubKeyALG_DH

Diffie Hellman Public Key algorithm

PubKeyALG_Unknown OID

Unknown Public Key algorithm

Instances

Instances details
Show PubKeyALG Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

OIDable PubKeyALG Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

Methods

getObjectID :: PubKeyALG -> OID #

Eq PubKeyALG Source # 
Instance details

Defined in Data.X509.AlgorithmIdentifier

data SignatureALG Source #

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.

Constructors

SignatureALG HashALG PubKeyALG 
SignatureALG_IntrinsicHash PubKeyALG 
SignatureALG_Unknown OID 
SignatureALG_RSAPSS PSSParams

RSASSA-PSS with parameters other than defaultPSSParams. With the default parameters, SignatureALG h PubKeyALG_RSAPSS is used instead; rsaPSSSignatureALG picks the right form.

rsaPSSSignatureALG :: PSSParams -> SignatureALG Source #

The RSASSA-PSS signature algorithm with the given parameters.

signatureALGPSSParams :: SignatureALG -> Maybe PSSParams Source #

The RSASSA-PSS parameters of a signature algorithm, if any.

class Extension a where Source #

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

Minimal complete definition

extOID, extHasNestedASN1, extEncode, extDecode

Instances

Instances details
Extension ExtAuthorityKeyId Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtBasicConstraints Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtCrlDistributionPoints Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtExtendedKeyUsage Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtKeyUsage Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtNameConstraints Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtNetscapeComment Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtSubjectAltName Source # 
Instance details

Defined in Data.X509.Ext

Extension ExtSubjectKeyId Source # 
Instance details

Defined in Data.X509.Ext

data ExtKeyUsageFlag Source #

key usage flag that is found in the key usage extension field.

data ExtSubjectAltName Source #

Provide a way to supply alternate name that can be used for matching host name.

Constructors

ExtSubjectAltName [AltName] 

data ExtAuthorityKeyId where Source #

Authority key identifier (RFC 5280 4.2.1.1). The constructor is hidden; use defaultExtAuthorityKeyId and record update syntax.

Bundled Patterns

pattern ExtAuthorityKeyId :: ByteString -> ExtAuthorityKeyId

An identifier with a keyIdentifier. Constructing sets only the keyIdentifier.

data AltName Source #

GeneralName (RFC 5280 4.2.1.6).

Constructors

AltNameRFC822 String 
AltNameDNS String 
AltNameDN DistinguishedName 
AltNameURI String 
AltNameIP ByteString 
AltNameXMPP String 
AltNameDNSSRV String 
AltNameOther OID ByteString

otherName other than XMPP and SRV: the type and the DER encoding of the value

AltNameX400 ByteString

x400Address: the DER encoding of the ORAddress contents

AltNameEDIParty ByteString

ediPartyName: the DER encoding of the EDIPartyName contents

AltNameRegisteredID OID

registeredID

Instances

Instances details
Show AltName Source # 
Instance details

Defined in Data.X509.Ext

Eq AltName Source # 
Instance details

Defined in Data.X509.Ext

Methods

(==) :: AltName -> AltName -> Bool #

(/=) :: AltName -> AltName -> Bool #

Ord AltName Source # 
Instance details

Defined in Data.X509.Ext

data DistributionPoint Source #

Distribution point (RFC 5280 4.2.1.13). The constructor is hidden; use defaultDistributionPoint and record update syntax.

defaultDistributionPoint :: DistributionPoint Source #

No fields. A distribution point needs a name or a CRL issuer.

extensionGet :: Extension a => Extensions -> Maybe a Source #

Get a specific extension from a lists of raw extensions

extensionGetE :: Extension a => Extensions -> Maybe (Either String a) Source #

Get a specific extension from a lists of raw extensions

extensionDecode :: Extension a => ExtensionRaw -> Maybe (Either String a) Source #

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

extensionEncode :: Extension a => Bool -> a -> ExtensionRaw Source #

Encode an Extension to extensionRaw

data ExtensionRaw Source #

An undecoded extension

Constructors

ExtensionRaw 

Fields

Instances

Instances details
Show ExtensionRaw Source # 
Instance details

Defined in Data.X509.ExtensionRaw

ASN1Object ExtensionRaw Source # 
Instance details

Defined in Data.X509.ExtensionRaw

Eq ExtensionRaw Source # 
Instance details

Defined in Data.X509.ExtensionRaw

extRawASN1 :: ExtensionRaw -> [ASN1] Source #

Deprecated: use tryExtRawASN1 instead

newtype Extensions Source #

a Set of ExtensionRaw

Constructors

Extensions (Maybe [ExtensionRaw]) 

Instances

Instances details
Show Extensions Source # 
Instance details

Defined in Data.X509.ExtensionRaw

ASN1Object Extensions Source # 
Instance details

Defined in Data.X509.ExtensionRaw

Eq Extensions Source # 
Instance details

Defined in Data.X509.ExtensionRaw

Certificate Revocation List (CRL)

data CRL Source #

Describe a Certificate revocation list

Instances

Instances details
Show CRL Source # 
Instance details

Defined in Data.X509.CRL

Methods

showsPrec :: Int -> CRL -> ShowS #

show :: CRL -> String #

showList :: [CRL] -> ShowS #

ASN1Object CRL Source # 
Instance details

Defined in Data.X509.CRL

Methods

toASN1 :: CRL -> ASN1S #

fromASN1 :: [ASN1] -> Either String (CRL, [ASN1]) #

Eq CRL Source # 
Instance details

Defined in Data.X509.CRL

Methods

(==) :: CRL -> CRL -> Bool #

(/=) :: CRL -> CRL -> Bool #

data RevokedCertificate Source #

Describe a revoked certificate identifiable by serial number.

Naming

data DistinguishedName where Source #

A sequence of relative distinguished names. The constructor is hidden; use getRDNs and fromRDNs, or the DistinguishedName pattern for names without multi-valued RDNs.

Bundled Patterns

pattern DistinguishedName :: [(OID, ASN1CharacterString)] -> DistinguishedName

All attributes in order, flattening multi-valued RDNs. Constructing makes one RDN per attribute.

Instances

Instances details
Monoid DistinguishedName Source # 
Instance details

Defined in Data.X509.DistinguishedName

Semigroup DistinguishedName Source # 
Instance details

Defined in Data.X509.DistinguishedName

Show DistinguishedName Source # 
Instance details

Defined in Data.X509.DistinguishedName

ASN1Object DistinguishedName Source # 
Instance details

Defined in Data.X509.DistinguishedName

Eq DistinguishedName Source # 
Instance details

Defined in Data.X509.DistinguishedName

Ord DistinguishedName Source # 
Instance details

Defined in Data.X509.DistinguishedName

type RelativeDistinguishedName = [(OID, ASN1CharacterString)] Source #

A set of attribute types and values, usually with one element.

getRDNs :: DistinguishedName -> [RelativeDistinguishedName] Source #

The relative distinguished names.

fromRDNs :: [RelativeDistinguishedName] -> DistinguishedName Source #

A name from relative distinguished names.

data DnElement Source #

Elements commonly available in a DistinguishedName structure

Constructors

DnCommonName

CN

DnCountry

Country

DnOrganization

O

DnOrganizationUnit

OU

DnEmailAddress

Email Address (legacy)

DnLocality

L

DnStateOrProvince

ST

DnStreetAddress

Street address

DnPostalCode

Postal code

DnSerialNumber

Serial number

DnTitle

Title

DnName

Name

DnSurname

Surname

DnGivenName

Given name

DnInitials

Initials

DnGenerationQualifier

Generation qualifier

DnQualifier

DN qualifier

DnPseudonym

Pseudonym

DnDomainComponent

DC

DnUserId

UID

getDnElement :: DnElement -> DistinguishedName -> Maybe ASN1CharacterString Source #

Try to get a specific element in a DistinguishedName structure

canonicalDistinguishedName :: DistinguishedName -> DistinguishedName Source #

A form for comparing names (RFC 5280 7.1): string values are converted to UTF8String, lower-cased and whitespace is folded, and the attributes of each RDN are sorted. Values that cannot be decoded are kept.

Certificate Chain

newtype CertificateChain Source #

A chain of X.509 certificates in exact form.

newtype CertificateChainRaw Source #

Represent a chain of X.509 certificates in bytestring form.

decodeCertificateChain :: CertificateChainRaw -> Either (Int, String) CertificateChain Source #

Decode a CertificateChainRaw into a CertificateChain if every raw certificate are decoded correctly, otherwise return the index of the failed certificate and the error associated.

encodeCertificateChain :: CertificateChain -> CertificateChainRaw Source #

Convert a CertificateChain into a CertificateChainRaw

Signed types and marshalling

data (Show a, Eq a, ASN1Object a) => Signed a Source #

Represent a signed object using a traditional X509 structure.

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

Constructors

Signed 

Fields

Instances

Instances details
(Eq a, ASN1Object a, Show a) => Show (Signed a) Source # 
Instance details

Defined in Data.X509.Signed

Methods

showsPrec :: Int -> Signed a -> ShowS #

show :: Signed a -> String #

showList :: [Signed a] -> ShowS #

(Show a, ASN1Object a, Eq a) => Eq (Signed a) Source # 
Instance details

Defined in Data.X509.Signed

Methods

(==) :: Signed a -> Signed a -> Bool #

(/=) :: Signed a -> Signed a -> Bool #

data (Show a, Eq a, ASN1Object a) => SignedExact a Source #

Represent the signed object plus the raw data that we need to keep around for non compliant case to be able to verify signature.

Instances

Instances details
(Show a, Eq a, ASN1Object a) => Show (SignedExact a) Source # 
Instance details

Defined in Data.X509.Signed

(Show a, Eq a, ASN1Object a) => Eq (SignedExact a) Source # 
Instance details

Defined in Data.X509.Signed

getSigned :: SignedExact a -> Signed a Source #

get the decoded Signed data

getSignedData :: (Show a, Eq a, ASN1Object a) => SignedExact a -> ByteString Source #

Get the signed data for the signature

objectToSignedExact Source #

Arguments

:: (Show a, Eq a, ASN1Object a) 
=> (ByteString -> (ByteString, SignatureALG, r))

signature function

-> a

object to sign

-> (SignedExact a, r) 

Transform an object into a SignedExact object

objectToSignedExactF Source #

Arguments

:: (Functor f, Show a, Eq a, ASN1Object a) 
=> (ByteString -> f (ByteString, SignatureALG))

signature function

-> a

object to sign

-> f (SignedExact a) 

A generalization of objectToSignedExact where the signature function runs in an arbitrary functor. This allows for example to sign using an algorithm needing random values.

encodeSignedObject :: SignedExact a -> ByteString Source #

The raw representation of the whole signed structure

decodeSignedObject :: (Show a, Eq a, ASN1Object a) => ByteString -> Either String (SignedExact a) Source #

Try to parse a bytestring that use the typical X509 signed structure format

Parametrized Signed accessor

getCertificate :: SignedCertificate -> Certificate Source #

Get the Certificate associated to a SignedCertificate

getCRL :: SignedCRL -> CRL Source #

Get the CRL associated to a SignedCRL

decodeSignedCertificate :: ByteString -> Either String SignedCertificate Source #

Try to decode a bytestring to a SignedCertificate

decodeSignedCRL :: ByteString -> Either String SignedCRL Source #

Try to decode a bytestring to a SignedCRL

Hash distinguished names related function

hashDN :: DistinguishedName -> ByteString Source #

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.

hashDN_old :: DistinguishedName -> ByteString Source #

Create an openssl style old hash of distinguished name