abla/crypto/ocsp

Generated from source.

Import with import "abla/crypto/ocsp".

Source: abla/crypto/ocsp/entry.ab

OCSP_GOOD (val)

val OCSP_GOOD

The certificate is not revoked, as of the response.

OCSP_REVOKED (val)

val OCSP_REVOKED

The certificate is revoked (revokedAt, reason say when and why).

OCSP_UNKNOWN (val)

val OCSP_UNKNOWN

The responder does not know the certificate.

OCSP_INVALID (val)

val OCSP_INVALID

The response is not acceptable for the certificate: error says why.

OCSP_POLICY_OFF (val)

val OCSP_POLICY_OFF

No revocation check.

OCSP_POLICY_STAPLE (val)

val OCSP_POLICY_STAPLE

Use a staple when there is one (a revoked or invalid one refuses the path) and accept the lack of one, unless the leaf is must-staple (RFC 7633).

OCSP_POLICY_REQUIRE (val)

val OCSP_POLICY_REQUIRE

Require a good staple for the leaf.

OCSP_MAXIMUM_VALIDITY (val)

val OCSP_MAXIMUM_VALIDITY

The longest a response may say it is good for (nextUpdate - thisUpdate), in seconds: ten days (the CA/B Forum Baseline Requirements allow a subscriber certificate's response up to 10 days; some CAs issue 7 to 10).

OCSP_CLOCK_SKEW (val)

val OCSP_CLOCK_SKEW

The clock skew allowed for thisUpdate, in seconds.

OcspResult (class)

class OcspResult(val status: int, val error: string, val thisUpdate: int, val nextUpdate: int, val revokedAt: int, val reason: int)

What a response says about one certificate: status is one of OCSP_GOOD, OCSP_REVOKED, OCSP_UNKNOWN, OCSP_INVALID (then error is the reason; a response refused for its times still reports them); the times are seconds since 1970 (nextUpdate is 0 without one; revokedAt and reason are for a revoked status, the reason -1 when none was given).

ocspCheck (fun)

fun ocspCheck(response: string, leaf: X509Certificate, issuer: X509Certificate, now: int): OcspResult

What the OCSP response response (DER) says about leaf, whose issuer is issuer, at now (seconds since 1970).

ocspCheckPath (fun)

fun ocspCheckPath(path: array<X509Certificate>, staples: array<string>, policy: int, now: int): string

"" when the path may be used under policy and the staples (one OCSP response per certificate of the path in the same order, "" for none; path is the verified chain, the leaf first and the trust anchor last), else why not. A staple that is present is always judged (revoked, invalid and expired ones refuse the path; an unknown status refuses it under OCSP_POLICY_REQUIRE); a leaf without a good staple is refused under OCSP_POLICY_REQUIRE and when it is must-staple.

ocspRequestDer (fun)

fun ocspRequestDer(leaf: X509Certificate, issuer: X509Certificate): string

The DER of an OCSPRequest for leaf under issuer (one CertID with SHA-1, as responders expect, and no extensions): what an application POSTs to the responder of the certificate's authorityInfoAccess. Fetching it is the application's business; the answer is checked with ocspCheck.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.