| Copyright | (c) Alexey Radkov 2024 |
|---|---|
| License | BSD-style |
| Maintainer | alexey.radkov@gmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.X509.OCSP
Description
Encode and decode X509 OCSP requests and responses.
This module complies with rfc6960.
Synopsis
- data CertId = CertId {}
- encodeOCSPRequestASN1 :: Certificate -> Certificate -> ([ASN1], CertId)
- encodeOCSPRequest :: Certificate -> Certificate -> (ByteString, CertId)
- data OCSPResponse = OCSPResponse {}
- data OCSPResponseStatus
- data OCSPResponsePayload = OCSPResponsePayload {}
- data OCSPResponseCertData = OCSPResponseCertData {}
- data OCSPResponseCertStatus
- decodeOCSPResponse :: CertId -> ByteString -> Either ASN1Error (Maybe OCSPResponse)
Documentation
Certificate Id.
This data is used when building OCSP requests and parsing OCSP responses.
Constructors
| CertId | |
Fields
| |
encodeOCSPRequestASN1 Source #
Arguments
| :: Certificate | Issuer certificate |
| -> Certificate | Checked certificate |
| -> ([ASN1], CertId) |
Build and encode OCSP request in ASN1 format.
The returned value contains the encoded request and an object of type
CertId with hashes calculated by SHA1 algorithm.
Arguments
| :: Certificate | Issuer certificate |
| -> Certificate | Checked certificate |
| -> (ByteString, CertId) |
Build and encode OCSP request in ASN1 DER format.
The returned value contains the encoded request and an object of type
CertId with hashes calculated by SHA1 algorithm.
data OCSPResponse Source #
OCSP response data.
Constructors
| OCSPResponse | |
Fields
| |
Instances
| Show OCSPResponse Source # | |
Defined in Data.X509.OCSP Methods showsPrec :: Int -> OCSPResponse -> ShowS # show :: OCSPResponse -> String # showList :: [OCSPResponse] -> ShowS # | |
| Eq OCSPResponse Source # | |
Defined in Data.X509.OCSP | |
data OCSPResponseStatus Source #
Status of OCSP response as defined in rfc6960.
Constructors
| OCSPRespSuccessful | |
| OCSPRespMalformedRequest | |
| OCSPRespInternalError | |
| OCSPRespUnused1 | |
| OCSPRespTryLater | |
| OCSPRespSigRequired | |
| OCSPRespUnauthorized |
Instances
data OCSPResponsePayload Source #
OCSP response payload data.
Constructors
| OCSPResponsePayload | |
Fields
| |
Instances
| Show OCSPResponsePayload Source # | |
Defined in Data.X509.OCSP Methods showsPrec :: Int -> OCSPResponsePayload -> ShowS # show :: OCSPResponsePayload -> String # showList :: [OCSPResponsePayload] -> ShowS # | |
| Eq OCSPResponsePayload Source # | |
Defined in Data.X509.OCSP Methods (==) :: OCSPResponsePayload -> OCSPResponsePayload -> Bool # (/=) :: OCSPResponsePayload -> OCSPResponsePayload -> Bool # | |
data OCSPResponseCertData Source #
OCSP response certificate data.
Constructors
| OCSPResponseCertData | |
Fields
| |
Instances
| Show OCSPResponseCertData Source # | |
Defined in Data.X509.OCSP Methods showsPrec :: Int -> OCSPResponseCertData -> ShowS # show :: OCSPResponseCertData -> String # showList :: [OCSPResponseCertData] -> ShowS # | |
| Eq OCSPResponseCertData Source # | |
Defined in Data.X509.OCSP Methods (==) :: OCSPResponseCertData -> OCSPResponseCertData -> Bool # (/=) :: OCSPResponseCertData -> OCSPResponseCertData -> Bool # | |
data OCSPResponseCertStatus Source #
Status of the checked certificate as defined in rfc6960.
Constructors
| OCSPRespCertGood | |
| OCSPRespCertRevoked | |
| OCSPRespCertUnknown |
Instances
Arguments
| :: CertId | Certificate Id |
| -> ByteString | OCSP response |
| -> Either ASN1Error (Maybe OCSPResponse) |
Decode OCSP response.
Value of the certificate id is expected to be equal to what was returned
by encodeOCSPRequest: it is used to check the correctness of the response.
Left value gets returned on parse errors detected by decodeASN1.
Right value with Nothing gets returned on unexpected ASN1 contents.