| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.X509
Description
Read/Write X509 Certificate, CRL and their signed equivalents.
Follows RFC5280 / RFC6818
Synopsis
- type SignedCertificate = SignedExact Certificate
- type SignedCRL = SignedExact CRL
- data Certificate = Certificate {
- certVersion :: Int
- certSerial :: Integer
- certSignatureAlg :: SignatureALG
- certIssuerDN :: DistinguishedName
- certValidity :: (DateTime, DateTime)
- certSubjectDN :: DistinguishedName
- certPubKey :: PubKey
- certExtensions :: Extensions
- data PubKey
- = PubKeyRSA PublicKey
- | PubKeyRSAPSS PublicKey (Maybe PSSParams)
- | PubKeyDSA PublicKey
- | PubKeyDH PubKeyDH
- | PubKeyEC PubKeyEC
- | PubKeyX25519 PublicKey
- | PubKeyX448 PublicKey
- | PubKeyEd25519 PublicKey
- | PubKeyEd448 PublicKey
- | PubKeyMLDSA44 (VerificationKey MLDSA44)
- | PubKeyMLDSA65 (VerificationKey MLDSA65)
- | PubKeyMLDSA87 (VerificationKey MLDSA87)
- | PubKeyMLKEM512 (EncapsulationKey MLKEM512)
- | PubKeyMLKEM768 (EncapsulationKey MLKEM768)
- | PubKeyMLKEM1024 (EncapsulationKey MLKEM1024)
- | PubKeyUnknown OID ByteString
- data PubKeyEC
- = PubKeyEC_Prime {
- pubkeyEC_pub :: SerializedPoint
- pubkeyEC_a :: Integer
- pubkeyEC_b :: Integer
- pubkeyEC_prime :: Integer
- pubkeyEC_generator :: SerializedPoint
- pubkeyEC_order :: Integer
- pubkeyEC_cofactor :: Integer
- pubkeyEC_seed :: Integer
- | PubKeyEC_Named {
- pubkeyEC_name :: CurveName
- pubkeyEC_pub :: SerializedPoint
- = PubKeyEC_Prime {
- data PubKeyDH
- dhPublicKey :: Integer -> Integer -> Integer -> Integer -> PubKeyDH
- pubkeyDH_p :: PubKeyDH -> Integer
- pubkeyDH_g :: PubKeyDH -> Integer
- pubkeyDH_q :: PubKeyDH -> Integer
- pubkeyDH_j :: PubKeyDH -> Maybe Integer
- pubkeyDH_validation :: PubKeyDH -> Maybe (BitArray, Integer)
- pubkeyDH_y :: PubKeyDH -> Integer
- newtype SerializedPoint = SerializedPoint ByteString
- data PrivKey
- = PrivKeyRSA PrivateKey
- | PrivKeyRSAPSS PrivateKey (Maybe PSSParams)
- | PrivKeyDSA PrivateKey
- | PrivKeyEC PrivKeyEC
- | PrivKeyX25519 SecretKey
- | PrivKeyX448 SecretKey
- | PrivKeyEd25519 SecretKey
- | PrivKeyEd448 SecretKey
- | PrivKeyMLDSA44 (PrivKeyMLDSA MLDSA44)
- | PrivKeyMLDSA65 (PrivKeyMLDSA MLDSA65)
- | PrivKeyMLDSA87 (PrivKeyMLDSA MLDSA87)
- | PrivKeyMLKEM512 (PrivKeyMLKEM MLKEM512)
- | PrivKeyMLKEM768 (PrivKeyMLKEM MLKEM768)
- | PrivKeyMLKEM1024 (PrivKeyMLKEM MLKEM1024)
- data PrivKeyEC
- = PrivKeyEC_Prime {
- privkeyEC_priv :: Integer
- privkeyEC_a :: Integer
- privkeyEC_b :: Integer
- privkeyEC_prime :: Integer
- privkeyEC_generator :: SerializedPoint
- privkeyEC_order :: Integer
- privkeyEC_cofactor :: Integer
- privkeyEC_seed :: Integer
- | PrivKeyEC_Named {
- privkeyEC_name :: CurveName
- privkeyEC_priv :: Integer
- = PrivKeyEC_Prime {
- data PrivKeyMLDSA p
- data MLKeyForm
- type MLDSAKeyForm = MLKeyForm
- pattern MLDSAKeySeed :: MLKeyForm
- pattern MLDSAKeyExpanded :: MLKeyForm
- pattern MLDSAKeyBoth :: MLKeyForm
- privkeyMLDSAFromSeed :: (MLDSA p, ByteArrayAccess ba) => proxy p -> MLKeyForm -> ba -> CryptoFailable (PrivKeyMLDSA p)
- privkeyMLDSAFromKey :: SigningKey p -> PrivKeyMLDSA p
- privkeyMLDSA_key :: PrivKeyMLDSA p -> SigningKey p
- privkeyMLDSA_seed :: PrivKeyMLDSA p -> Maybe ScrubbedBytes
- privkeyMLDSA_form :: PrivKeyMLDSA p -> MLKeyForm
- data PrivKeyMLKEM p
- privkeyMLKEMFromSeed :: (MLKEM p, ByteArrayAccess ba) => proxy p -> MLKeyForm -> ba -> CryptoFailable (PrivKeyMLKEM p)
- privkeyMLKEMFromKey :: DecapsulationKey p -> PrivKeyMLKEM p
- privkeyMLKEM_key :: PrivKeyMLKEM p -> DecapsulationKey p
- privkeyMLKEM_seed :: PrivKeyMLKEM p -> Maybe ScrubbedBytes
- privkeyMLKEM_form :: PrivKeyMLKEM p -> MLKeyForm
- pubkeyToAlg :: PubKey -> PubKeyALG
- privkeyToAlg :: PrivKey -> PubKeyALG
- defaultPSSParams :: HashALG -> PSSParams
- rsaPSSSignatureALG :: PSSParams -> SignatureALG
- signatureALGPSSParams :: SignatureALG -> Maybe PSSParams
- data HashALG
- data PSSParams
- data PubKeyALG
- data SignatureALG
- defaultDistributionPoint :: DistributionPoint
- defaultExtAuthorityKeyId :: ExtAuthorityKeyId
- extensionDecode :: Extension a => ExtensionRaw -> Maybe (Either String a)
- extensionEncode :: Extension a => Bool -> a -> ExtensionRaw
- extensionGet :: Extension a => Extensions -> Maybe a
- extensionGetE :: Extension a => Extensions -> Maybe (Either String a)
- recognizedOIDs :: [OID]
- data AltName
- = AltNameRFC822 String
- | AltNameDNS String
- | AltNameDN DistinguishedName
- | AltNameURI String
- | AltNameIP ByteString
- | AltNameXMPP String
- | AltNameDNSSRV String
- | AltNameOther OID ByteString
- | AltNameX400 ByteString
- | AltNameEDIParty ByteString
- | AltNameRegisteredID OID
- data DistributionPoint
- data DistributionPointName
- data ExtAuthorityKeyId where
- pattern ExtAuthorityKeyId :: ByteString -> ExtAuthorityKeyId
- data ExtBasicConstraints = ExtBasicConstraints Bool (Maybe Integer)
- data ExtCrlDistributionPoints = ExtCrlDistributionPoints [DistributionPoint]
- data ExtExtendedKeyUsage = ExtExtendedKeyUsage [ExtKeyUsagePurpose]
- data ExtKeyUsage = ExtKeyUsage [ExtKeyUsageFlag]
- data ExtKeyUsageFlag
- data ExtKeyUsagePurpose
- data ExtNameConstraints = ExtNameConstraints [GeneralSubtree] [GeneralSubtree]
- data ExtNetscapeComment = ExtNetscapeComment ByteString
- data ExtSubjectAltName = ExtSubjectAltName [AltName]
- data ExtSubjectKeyId = ExtSubjectKeyId ByteString
- class Extension a where
- extOID :: a -> OID
- extHasNestedASN1 :: Proxy a -> Bool
- extEncode :: a -> [ASN1]
- extDecode :: [ASN1] -> Either String a
- extDecodeBs :: ByteString -> Either String a
- extEncodeBs :: a -> ByteString
- data GeneralSubtree = GeneralSubtree AltName Integer (Maybe Integer)
- data ReasonFlag
- extRawASN1 :: ExtensionRaw -> [ASN1]
- tryExtRawASN1 :: ExtensionRaw -> Either String [ASN1]
- data ExtensionRaw = ExtensionRaw {
- extRawOID :: OID
- extRawCritical :: Bool
- extRawContent :: ByteString
- newtype Extensions = Extensions (Maybe [ExtensionRaw])
- data CRL = CRL {
- crlVersion :: Integer
- crlSignatureAlg :: SignatureALG
- crlIssuer :: DistinguishedName
- crlThisUpdate :: DateTime
- crlNextUpdate :: Maybe DateTime
- crlRevokedCertificates :: [RevokedCertificate]
- crlExtensions :: Extensions
- data RevokedCertificate = RevokedCertificate {
- revokedSerialNumber :: Integer
- revokedDate :: DateTime
- revokedExtensions :: Extensions
- data DistinguishedName where
- pattern DistinguishedName :: [(OID, ASN1CharacterString)] -> DistinguishedName
- type RelativeDistinguishedName = [(OID, ASN1CharacterString)]
- getRDNs :: DistinguishedName -> [RelativeDistinguishedName]
- fromRDNs :: [RelativeDistinguishedName] -> DistinguishedName
- data DnElement
- data ASN1CharacterString = ASN1CharacterString {
- characterEncoding :: ASN1StringEncoding
- getCharacterStringRawData :: ByteString
- getDnElement :: DnElement -> DistinguishedName -> Maybe ASN1CharacterString
- canonicalDistinguishedName :: DistinguishedName -> DistinguishedName
- decodeCertificateChain :: CertificateChainRaw -> Either (Int, String) CertificateChain
- encodeCertificateChain :: CertificateChain -> CertificateChainRaw
- newtype CertificateChain = CertificateChain [SignedExact Certificate]
- newtype CertificateChainRaw = CertificateChainRaw [ByteString]
- data (Show a, Eq a, ASN1Object a) => Signed a = Signed {
- signedObject :: a
- signedAlg :: SignatureALG
- signedSignature :: ByteString
- data (Show a, Eq a, ASN1Object a) => SignedExact a
- getSigned :: SignedExact a -> Signed a
- getSignedData :: (Show a, Eq a, ASN1Object a) => SignedExact a -> ByteString
- objectToSignedExact :: (Show a, Eq a, ASN1Object a) => (ByteString -> (ByteString, SignatureALG, r)) -> a -> (SignedExact a, r)
- objectToSignedExactF :: (Functor f, Show a, Eq a, ASN1Object a) => (ByteString -> f (ByteString, SignatureALG)) -> a -> f (SignedExact a)
- encodeSignedObject :: SignedExact a -> ByteString
- decodeSignedObject :: (Show a, Eq a, ASN1Object a) => ByteString -> Either String (SignedExact a)
- getCertificate :: SignedCertificate -> Certificate
- getCRL :: SignedCRL -> CRL
- decodeSignedCertificate :: ByteString -> Either String SignedCertificate
- decodeSignedCRL :: ByteString -> Either String SignedCRL
- hashDN :: DistinguishedName -> ByteString
- hashDN_old :: DistinguishedName -> ByteString
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
| ASN1Object Certificate Source # | |
Defined in Data.X509.Cert | |
| Eq Certificate Source # | |
Defined in Data.X509.Cert | |
| Show Certificate Source # | |
Defined in Data.X509.Cert Methods showsPrec :: Int -> Certificate -> ShowS show :: Certificate -> String showList :: [Certificate] -> ShowS | |
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 |
Elliptic Curve Public Key
TODO: missing support for binary curve.
Constructors
| PubKeyEC_Prime | |
Fields
| |
| PubKeyEC_Named | |
Fields
| |
X9.42 Diffie-Hellman public key (RFC 3279 2.3.3). The constructor is
hidden; use dhPublicKey and record update syntax.
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_p :: PubKeyDH -> Integer Source #
the prime
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_validation :: PubKeyDH -> Maybe (BitArray, Integer) Source #
seed and pgenCounter
pubkeyDH_y :: PubKeyDH -> Integer Source #
the public value
newtype SerializedPoint Source #
Serialized Elliptic Curve Point
Constructors
| SerializedPoint ByteString |
Instances
| Eq SerializedPoint Source # | |
Defined in Data.X509.PublicKey Methods (==) :: SerializedPoint -> SerializedPoint -> Bool (/=) :: SerializedPoint -> SerializedPoint -> Bool | |
| Show SerializedPoint Source # | |
Defined in Data.X509.PublicKey Methods showsPrec :: Int -> SerializedPoint -> ShowS show :: SerializedPoint -> String showList :: [SerializedPoint] -> ShowS | |
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
| 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 |
Defined in Data.X509.PrivateKey | |
| ASN1Object PrivKey Source # | |
Defined in Data.X509.PrivateKey | |
| Eq PrivKey Source # | |
| Show PrivKey Source # | |
Elliptic Curve Private Key
TODO: missing support for binary curve.
Constructors
| PrivKeyEC_Prime | |
Fields
| |
| PrivKeyEC_Named | |
Fields
| |
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
| DebugShow (PrivKeyMLDSA p) Source # | |
Defined in Data.X509.PrivateKey Methods debugShow :: PrivKeyMLDSA p -> String | |
| Eq (PrivKeyMLDSA p) Source # | |
Defined in Data.X509.PrivateKey Methods (==) :: PrivKeyMLDSA p -> PrivKeyMLDSA p -> Bool (/=) :: PrivKeyMLDSA p -> PrivKeyMLDSA p -> Bool | |
| Show (PrivKeyMLDSA p) Source # | The form is shown; neither the seed nor the key is. Use
|
Defined in Data.X509.PrivateKey Methods showsPrec :: Int -> PrivKeyMLDSA p -> ShowS show :: PrivKeyMLDSA p -> String showList :: [PrivKeyMLDSA p] -> ShowS | |
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, |
| MLKeyExpanded | The expanded key alone, |
| MLKeyBoth | Both together, |
Instances
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
| MLKEM p => DebugShow (PrivKeyMLKEM p) Source # | |
Defined in Data.X509.PrivateKey Methods debugShow :: PrivKeyMLKEM p -> String | |
| MLKEM p => Eq (PrivKeyMLKEM p) Source # | |
Defined in Data.X509.PrivateKey Methods (==) :: PrivKeyMLKEM p -> PrivKeyMLKEM p -> Bool (/=) :: PrivKeyMLKEM p -> PrivKeyMLKEM p -> Bool | |
| MLKEM p => Show (PrivKeyMLKEM p) Source # | The form is shown; neither the seed nor the key is. |
Defined in Data.X509.PrivateKey Methods showsPrec :: Int -> PrivKeyMLKEM p -> ShowS show :: PrivKeyMLKEM p -> String showList :: [PrivKeyMLKEM p] -> ShowS | |
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
defaultPSSParams :: HashALG -> PSSParams Source #
The hash for both the message and MGF1, and the salt length equal to the hash length.
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.
Hash Algorithm
Constructors
| HashMD2 | |
| HashMD5 | |
| HashSHA1 | |
| HashSHA224 | |
| HashSHA256 | |
| HashSHA384 | |
| HashSHA512 | |
| HashSHA3_224 | |
| HashSHA3_256 | |
| HashSHA3_384 | |
| HashSHA3_512 |
Instances
RSASSA-PSS parameters (RFC 4055). Only MGF1 and the trailer field 1
are supported. The constructor is hidden; use defaultPSSParams and
record update syntax.
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 |
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 |
Instances
| ASN1Object SignatureALG Source # | |
Defined in Data.X509.AlgorithmIdentifier | |
| Eq SignatureALG Source # | |
Defined in Data.X509.AlgorithmIdentifier | |
| Show SignatureALG Source # | |
Defined in Data.X509.AlgorithmIdentifier Methods showsPrec :: Int -> SignatureALG -> ShowS show :: SignatureALG -> String showList :: [SignatureALG] -> ShowS | |
defaultDistributionPoint :: DistributionPoint Source #
No fields. A distribution point needs a name or a CRL issuer.
defaultExtAuthorityKeyId :: ExtAuthorityKeyId Source #
No fields.
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
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
recognizedOIDs :: [OID] 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 |
data DistributionPoint Source #
Distribution point (RFC 5280 4.2.1.13). The constructor is hidden;
use defaultDistributionPoint and record update syntax.
Instances
| Eq DistributionPoint Source # | |
Defined in Data.X509.Ext Methods (==) :: DistributionPoint -> DistributionPoint -> Bool (/=) :: DistributionPoint -> DistributionPoint -> Bool | |
| Show DistributionPoint Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> DistributionPoint -> ShowS show :: DistributionPoint -> String showList :: [DistributionPoint] -> ShowS | |
data DistributionPointName Source #
The name of a distribution point.
Constructors
| DistributionPointFullName [AltName] | |
| DistributionPointRelativeName RelativeDistinguishedName |
Instances
| Eq DistributionPointName Source # | |
Defined in Data.X509.Ext Methods (==) :: DistributionPointName -> DistributionPointName -> Bool (/=) :: DistributionPointName -> DistributionPointName -> Bool | |
| Show DistributionPointName Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> DistributionPointName -> ShowS show :: DistributionPointName -> String showList :: [DistributionPointName] -> ShowS | |
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. |
Instances
| Extension ExtAuthorityKeyId Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtAuthorityKeyId -> OID Source # extHasNestedASN1 :: Proxy ExtAuthorityKeyId -> Bool Source # extEncode :: ExtAuthorityKeyId -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtAuthorityKeyId Source # extDecodeBs :: ByteString -> Either String ExtAuthorityKeyId Source # extEncodeBs :: ExtAuthorityKeyId -> ByteString Source # | |
| Eq ExtAuthorityKeyId Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtAuthorityKeyId -> ExtAuthorityKeyId -> Bool (/=) :: ExtAuthorityKeyId -> ExtAuthorityKeyId -> Bool | |
| Show ExtAuthorityKeyId Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtAuthorityKeyId -> ShowS show :: ExtAuthorityKeyId -> String showList :: [ExtAuthorityKeyId] -> ShowS | |
data ExtBasicConstraints Source #
Basic Constraints
Constructors
| ExtBasicConstraints Bool (Maybe Integer) |
Instances
| Extension ExtBasicConstraints Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtBasicConstraints -> OID Source # extHasNestedASN1 :: Proxy ExtBasicConstraints -> Bool Source # extEncode :: ExtBasicConstraints -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtBasicConstraints Source # extDecodeBs :: ByteString -> Either String ExtBasicConstraints Source # extEncodeBs :: ExtBasicConstraints -> ByteString Source # | |
| Eq ExtBasicConstraints Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtBasicConstraints -> ExtBasicConstraints -> Bool (/=) :: ExtBasicConstraints -> ExtBasicConstraints -> Bool | |
| Show ExtBasicConstraints Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtBasicConstraints -> ShowS show :: ExtBasicConstraints -> String showList :: [ExtBasicConstraints] -> ShowS | |
data ExtCrlDistributionPoints Source #
Identify how CRL information is obtained
Constructors
| ExtCrlDistributionPoints [DistributionPoint] |
Instances
| Extension ExtCrlDistributionPoints Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtCrlDistributionPoints -> OID Source # extHasNestedASN1 :: Proxy ExtCrlDistributionPoints -> Bool Source # extEncode :: ExtCrlDistributionPoints -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtCrlDistributionPoints Source # extDecodeBs :: ByteString -> Either String ExtCrlDistributionPoints Source # extEncodeBs :: ExtCrlDistributionPoints -> ByteString Source # | |
| Eq ExtCrlDistributionPoints Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtCrlDistributionPoints -> ExtCrlDistributionPoints -> Bool (/=) :: ExtCrlDistributionPoints -> ExtCrlDistributionPoints -> Bool | |
| Show ExtCrlDistributionPoints Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtCrlDistributionPoints -> ShowS show :: ExtCrlDistributionPoints -> String showList :: [ExtCrlDistributionPoints] -> ShowS | |
data ExtExtendedKeyUsage Source #
Extended key usage extension
Constructors
| ExtExtendedKeyUsage [ExtKeyUsagePurpose] |
Instances
| Extension ExtExtendedKeyUsage Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtExtendedKeyUsage -> OID Source # extHasNestedASN1 :: Proxy ExtExtendedKeyUsage -> Bool Source # extEncode :: ExtExtendedKeyUsage -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtExtendedKeyUsage Source # extDecodeBs :: ByteString -> Either String ExtExtendedKeyUsage Source # extEncodeBs :: ExtExtendedKeyUsage -> ByteString Source # | |
| Eq ExtExtendedKeyUsage Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtExtendedKeyUsage -> ExtExtendedKeyUsage -> Bool (/=) :: ExtExtendedKeyUsage -> ExtExtendedKeyUsage -> Bool | |
| Show ExtExtendedKeyUsage Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtExtendedKeyUsage -> ShowS show :: ExtExtendedKeyUsage -> String showList :: [ExtExtendedKeyUsage] -> ShowS | |
data ExtKeyUsage Source #
Describe key usage
Constructors
| ExtKeyUsage [ExtKeyUsageFlag] |
Instances
| Extension ExtKeyUsage Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtKeyUsage -> OID Source # extHasNestedASN1 :: Proxy ExtKeyUsage -> Bool Source # extEncode :: ExtKeyUsage -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtKeyUsage Source # extDecodeBs :: ByteString -> Either String ExtKeyUsage Source # extEncodeBs :: ExtKeyUsage -> ByteString Source # | |
| Eq ExtKeyUsage Source # | |
Defined in Data.X509.Ext | |
| Show ExtKeyUsage Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtKeyUsage -> ShowS show :: ExtKeyUsage -> String showList :: [ExtKeyUsage] -> ShowS | |
data ExtKeyUsageFlag Source #
key usage flag that is found in the key usage extension field.
Constructors
Instances
data ExtKeyUsagePurpose Source #
Key usage purposes for the ExtendedKeyUsage extension
Constructors
| KeyUsagePurpose_ServerAuth | |
| KeyUsagePurpose_ClientAuth | |
| KeyUsagePurpose_CodeSigning | |
| KeyUsagePurpose_EmailProtection | |
| KeyUsagePurpose_TimeStamping | |
| KeyUsagePurpose_OCSPSigning | |
| KeyUsagePurpose_Unknown OID |
Instances
| Eq ExtKeyUsagePurpose Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Bool (/=) :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Bool | |
| Ord ExtKeyUsagePurpose Source # | |
Defined in Data.X509.Ext Methods compare :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Ordering (<) :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Bool (<=) :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Bool (>) :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Bool (>=) :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> Bool max :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> ExtKeyUsagePurpose min :: ExtKeyUsagePurpose -> ExtKeyUsagePurpose -> ExtKeyUsagePurpose | |
| Show ExtKeyUsagePurpose Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtKeyUsagePurpose -> ShowS show :: ExtKeyUsagePurpose -> String showList :: [ExtKeyUsagePurpose] -> ShowS | |
data ExtNameConstraints Source #
Constructors
| ExtNameConstraints [GeneralSubtree] [GeneralSubtree] |
Instances
| Extension ExtNameConstraints Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtNameConstraints -> OID Source # extHasNestedASN1 :: Proxy ExtNameConstraints -> Bool Source # extEncode :: ExtNameConstraints -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtNameConstraints Source # extDecodeBs :: ByteString -> Either String ExtNameConstraints Source # extEncodeBs :: ExtNameConstraints -> ByteString Source # | |
| Eq ExtNameConstraints Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtNameConstraints -> ExtNameConstraints -> Bool (/=) :: ExtNameConstraints -> ExtNameConstraints -> Bool | |
| Show ExtNameConstraints Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtNameConstraints -> ShowS show :: ExtNameConstraints -> String showList :: [ExtNameConstraints] -> ShowS | |
data ExtNetscapeComment Source #
Constructors
| ExtNetscapeComment ByteString |
Instances
| Extension ExtNetscapeComment Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtNetscapeComment -> OID Source # extHasNestedASN1 :: Proxy ExtNetscapeComment -> Bool Source # extEncode :: ExtNetscapeComment -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtNetscapeComment Source # extDecodeBs :: ByteString -> Either String ExtNetscapeComment Source # extEncodeBs :: ExtNetscapeComment -> ByteString Source # | |
| Eq ExtNetscapeComment Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtNetscapeComment -> ExtNetscapeComment -> Bool (/=) :: ExtNetscapeComment -> ExtNetscapeComment -> Bool | |
| Show ExtNetscapeComment Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtNetscapeComment -> ShowS show :: ExtNetscapeComment -> String showList :: [ExtNetscapeComment] -> ShowS | |
data ExtSubjectAltName Source #
Provide a way to supply alternate name that can be used for matching host name.
Constructors
| ExtSubjectAltName [AltName] |
Instances
data ExtSubjectKeyId Source #
Provide a way to identify a public key by a short hash.
Constructors
| ExtSubjectKeyId ByteString |
Instances
| Extension ExtSubjectKeyId Source # | |
Defined in Data.X509.Ext Methods extOID :: ExtSubjectKeyId -> OID Source # extHasNestedASN1 :: Proxy ExtSubjectKeyId -> Bool Source # extEncode :: ExtSubjectKeyId -> [ASN1] Source # extDecode :: [ASN1] -> Either String ExtSubjectKeyId Source # extDecodeBs :: ByteString -> Either String ExtSubjectKeyId Source # extEncodeBs :: ExtSubjectKeyId -> ByteString Source # | |
| Eq ExtSubjectKeyId Source # | |
Defined in Data.X509.Ext Methods (==) :: ExtSubjectKeyId -> ExtSubjectKeyId -> Bool (/=) :: ExtSubjectKeyId -> ExtSubjectKeyId -> Bool | |
| Show ExtSubjectKeyId Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ExtSubjectKeyId -> ShowS show :: ExtSubjectKeyId -> String showList :: [ExtSubjectKeyId] -> ShowS | |
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
Methods
extHasNestedASN1 :: Proxy a -> Bool Source #
extEncode :: a -> [ASN1] Source #
extDecode :: [ASN1] -> Either String a Source #
extDecodeBs :: ByteString -> Either String a Source #
extEncodeBs :: a -> ByteString Source #
Instances
data GeneralSubtree Source #
Constructors
| GeneralSubtree AltName Integer (Maybe Integer) |
Instances
| Eq GeneralSubtree Source # | |
Defined in Data.X509.Ext Methods (==) :: GeneralSubtree -> GeneralSubtree -> Bool (/=) :: GeneralSubtree -> GeneralSubtree -> Bool | |
| Show GeneralSubtree Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> GeneralSubtree -> ShowS show :: GeneralSubtree -> String showList :: [GeneralSubtree] -> ShowS | |
data ReasonFlag Source #
Reason flag for the CRL
Constructors
| Reason_Unused | |
| Reason_KeyCompromise | |
| Reason_CACompromise | |
| Reason_AffiliationChanged | |
| Reason_Superseded | |
| Reason_CessationOfOperation | |
| Reason_CertificateHold | |
| Reason_PrivilegeWithdrawn | |
| Reason_AACompromise |
Instances
| Eq ReasonFlag Source # | |
Defined in Data.X509.Ext | |
| Ord ReasonFlag Source # | |
Defined in Data.X509.Ext Methods compare :: ReasonFlag -> ReasonFlag -> Ordering (<) :: ReasonFlag -> ReasonFlag -> Bool (<=) :: ReasonFlag -> ReasonFlag -> Bool (>) :: ReasonFlag -> ReasonFlag -> Bool (>=) :: ReasonFlag -> ReasonFlag -> Bool max :: ReasonFlag -> ReasonFlag -> ReasonFlag min :: ReasonFlag -> ReasonFlag -> ReasonFlag | |
| Enum ReasonFlag Source # | |
Defined in Data.X509.Ext Methods succ :: ReasonFlag -> ReasonFlag pred :: ReasonFlag -> ReasonFlag toEnum :: Int -> ReasonFlag fromEnum :: ReasonFlag -> Int enumFrom :: ReasonFlag -> [ReasonFlag] enumFromThen :: ReasonFlag -> ReasonFlag -> [ReasonFlag] enumFromTo :: ReasonFlag -> ReasonFlag -> [ReasonFlag] enumFromThenTo :: ReasonFlag -> ReasonFlag -> ReasonFlag -> [ReasonFlag] | |
| Show ReasonFlag Source # | |
Defined in Data.X509.Ext Methods showsPrec :: Int -> ReasonFlag -> ShowS show :: ReasonFlag -> String showList :: [ReasonFlag] -> ShowS | |
extRawASN1 :: ExtensionRaw -> [ASN1] Source #
Deprecated: use tryExtRawASN1 instead
tryExtRawASN1 :: ExtensionRaw -> Either String [ASN1] Source #
data ExtensionRaw Source #
An undecoded extension
Constructors
| ExtensionRaw | |
Fields
| |
Instances
| ASN1Object ExtensionRaw Source # | |
Defined in Data.X509.ExtensionRaw | |
| Eq ExtensionRaw Source # | |
Defined in Data.X509.ExtensionRaw | |
| Show ExtensionRaw Source # | |
Defined in Data.X509.ExtensionRaw Methods showsPrec :: Int -> ExtensionRaw -> ShowS show :: ExtensionRaw -> String showList :: [ExtensionRaw] -> ShowS | |
newtype Extensions Source #
a Set of ExtensionRaw
Constructors
| Extensions (Maybe [ExtensionRaw]) |
Instances
| ASN1Object Extensions Source # | |
Defined in Data.X509.ExtensionRaw | |
| Eq Extensions Source # | |
Defined in Data.X509.ExtensionRaw | |
| Show Extensions Source # | |
Defined in Data.X509.ExtensionRaw Methods showsPrec :: Int -> Extensions -> ShowS show :: Extensions -> String showList :: [Extensions] -> ShowS | |
Certificate Revocation List (CRL)
Describe a Certificate revocation list
Constructors
| CRL | |
Fields
| |
data RevokedCertificate Source #
Describe a revoked certificate identifiable by serial number.
Constructors
| RevokedCertificate | |
Fields
| |
Instances
| ASN1Object RevokedCertificate Source # | |
Defined in Data.X509.CRL Methods toASN1 :: RevokedCertificate -> ASN1S fromASN1 :: [ASN1] -> Either String (RevokedCertificate, [ASN1]) | |
| Eq RevokedCertificate Source # | |
Defined in Data.X509.CRL Methods (==) :: RevokedCertificate -> RevokedCertificate -> Bool (/=) :: RevokedCertificate -> RevokedCertificate -> Bool | |
| Show RevokedCertificate Source # | |
Defined in Data.X509.CRL Methods showsPrec :: Int -> RevokedCertificate -> ShowS show :: RevokedCertificate -> String showList :: [RevokedCertificate] -> ShowS | |
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
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.
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 |
Instances
| OIDNameable DnElement Source # | |
Defined in Data.X509.DistinguishedName Methods fromObjectID :: OID -> Maybe DnElement | |
| OIDable DnElement Source # | |
Defined in Data.X509.DistinguishedName Methods getObjectID :: DnElement -> OID | |
| Eq DnElement Source # | |
| Bounded DnElement Source # | |
Defined in Data.X509.DistinguishedName | |
| Enum DnElement Source # | |
Defined in Data.X509.DistinguishedName | |
| Show DnElement Source # | |
data ASN1CharacterString #
Constructors
| ASN1CharacterString | |
Fields
| |
Instances
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
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
newtype CertificateChain Source #
A chain of X.509 certificates in exact form.
Constructors
| CertificateChain [SignedExact Certificate] |
Instances
| Eq CertificateChain Source # | |
Defined in Data.X509.CertificateChain Methods (==) :: CertificateChain -> CertificateChain -> Bool (/=) :: CertificateChain -> CertificateChain -> Bool | |
| Show CertificateChain Source # | |
Defined in Data.X509.CertificateChain Methods showsPrec :: Int -> CertificateChain -> ShowS show :: CertificateChain -> String showList :: [CertificateChain] -> ShowS | |
newtype CertificateChainRaw Source #
Represent a chain of X.509 certificates in bytestring form.
Constructors
| CertificateChainRaw [ByteString] |
Instances
| Eq CertificateChainRaw Source # | |
Defined in Data.X509.CertificateChain Methods (==) :: CertificateChainRaw -> CertificateChainRaw -> Bool (/=) :: CertificateChainRaw -> CertificateChainRaw -> Bool | |
| Show CertificateChainRaw Source # | |
Defined in Data.X509.CertificateChain Methods showsPrec :: Int -> CertificateChainRaw -> ShowS show :: CertificateChainRaw -> String showList :: [CertificateChainRaw] -> ShowS | |
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
| |
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
| (Show a, Eq a, ASN1Object a) => Eq (SignedExact a) Source # | |
Defined in Data.X509.Signed | |
| (Show a, Eq a, ASN1Object a) => Show (SignedExact a) Source # | |
Defined in Data.X509.Signed Methods showsPrec :: Int -> SignedExact a -> ShowS show :: SignedExact a -> String showList :: [SignedExact a] -> ShowS | |
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
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
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
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