CertificateStoreCtx

The CertificateStoreCtx is a wrapper to the SSLVerifyCallback X509_STORE_CTX parameter.

It allows retrieving the peer certificate, and examining any errors during validation.

More...

Constructors

this
this(X509_STORE_CTX* ctx)

This constructor takes a X509_STORE_CTX as provided by the SSLVerifyCallback function.

Members

Functions

cert
Certificate cert()

Returns the peer certificate.

error
int error()
Undocumented in source. Be warned that the author may not have intended to support it.
errorDepth
int errorDepth()
Undocumented in source. Be warned that the author may not have intended to support it.

Detailed Description

The following example will probably change sometime soon.

Example

extern (C)
{
    int myCallback(int code, X509_STORE_CTX *ctx)
    {
        auto myCtx = new CertificateStoreCtx(ctx);
        Certificate cert = myCtx.cert;
        Stdout(cert.subject).newline;
        return 0; // BAD CERT! (1 is good)
    }
}

Meta