botan-bindings-0.0.1.0: Raw Botan bindings
Copyright(c) Leo D 2023
LicenseBSD-3-Clause
Maintainerleo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Botan.Bindings.X509

Description

A certificate is a binding between some identifying information (called a subject) and a public key. This binding is asserted by a signature on the certificate, which is placed there by some authority (the issuer) that at least claims that it knows the subject named in the certificate really “owns” the private key corresponding to the public key in the certificate.

The major certificate format in use today is X.509v3, used for instance in the Transport Layer Security (TLS) protocol.

Synopsis

Documentation

data BotanX509CertStruct Source #

Opaque X509Cert struct

botan_x509_cert_load Source #

Arguments

:: Ptr BotanX509Cert

cert_obj

-> ConstPtr Word8

cert[]

-> CSize

cert_len

-> IO CInt 

botan_x509_cert_not_before Source #

Arguments

:: BotanX509Cert

cert

-> Ptr Word64

time_since_epoch

-> IO CInt 

botan_x509_cert_not_after Source #

Arguments

:: BotanX509Cert

cert

-> Ptr Word64

time_since_epoch

-> IO CInt 

pattern NO_CONSTRAINTS :: (Eq a, Num a) => a Source #

pattern DIGITAL_SIGNATURE :: (Eq a, Num a) => a Source #

pattern NON_REPUDIATION :: (Eq a, Num a) => a Source #

pattern KEY_ENCIPHERMENT :: (Eq a, Num a) => a Source #

pattern DATA_ENCIPHERMENT :: (Eq a, Num a) => a Source #

pattern KEY_AGREEMENT :: (Eq a, Num a) => a Source #

pattern KEY_CERT_SIGN :: (Eq a, Num a) => a Source #

pattern CRL_SIGN :: (Eq a, Num a) => a Source #

pattern ENCIPHER_ONLY :: (Eq a, Num a) => a Source #

pattern DECIPHER_ONLY :: (Eq a, Num a) => a Source #

botan_x509_cert_hostname_match Source #

Arguments

:: BotanX509Cert

cert

-> ConstPtr CChar

hostname

-> IO CInt 

Check if the certificate matches the specified hostname via alternative name or CN match. RFC 5280 wildcards also supported.

botan_x509_cert_verify Source #

Arguments

:: Ptr CInt

validation_result

-> BotanX509Cert

cert

-> ConstPtr BotanX509Cert

intermediates

-> CSize

intermediates_len

-> ConstPtr BotanX509Cert

trusted

-> CSize

trusted_len

-> ConstPtr CChar

trusted_path

-> CSize

required_strength

-> ConstPtr CChar

hostname

-> Word64

reference_time

-> IO CInt 

Returns 0 if the validation was successful, 1 if validation failed, and negative on error. A status code with details is written to *validation_result

Intermediates or trusted lists can be null Trusted path can be null

botan_x509_cert_validation_status Source #

Arguments

:: CInt

code

-> IO (ConstPtr CChar) 

Returns a pointer to a static character string explaining the status code, or else NULL if unknown.

data BotanX509CRLStruct Source #

Opaque X509CRL struct

botan_x509_crl_load Source #

Arguments

:: Ptr BotanX509CRL

crl_obj

-> ConstPtr Word8

crl_bits[]

-> CSize

crl_bits_len

-> IO CInt 

botan_x509_is_revoked Source #

Arguments

:: BotanX509CRL

crl

-> BotanX509Cert

cert

-> IO CInt 

Given a CRL and a certificate, check if the certificate is revoked on that particular CRL

botan_x509_cert_verify_with_crl Source #

Arguments

:: Ptr CInt

validation_result

-> BotanX509Cert

cert

-> ConstPtr BotanX509Cert

intermediates

-> CSize

intermediates_len

-> ConstPtr BotanX509Cert

trusted

-> CSize

trusted_len

-> ConstPtr BotanX509CRL

crls

-> CSize

crls_len

-> ConstPtr CChar

trusted_path

-> CSize

required_strength

-> ConstPtr CChar

hostname

-> Word64

reference_time

-> IO CInt 

Different flavor of botan_x509_cert_verify, supports revocation lists. CRLs are passed as an array, same as intermediates and trusted CAs