(rfc x.509) - X.509 certificate utility library

This library does not support whole feature of X.509, it just parse and verify a message and signature. So it can not verify certificate itself.

Library (rfc x.509)

Exports X.509 utility procedures.

Generic make-x509-certificate (in )
Generic make-x509-certificate (sequence <asn.1-sequence>)

Creates an X.509 certificate object from given binary input port or ASN.1 sequence object (second form).

Function x509-certificate? o

Return #t if the o is X.509 certificate object, otherwise #f.

Function x509-certificate-get-version x509

Return version of given X.509 certificate object.

Function x509-certificate-get-serial-number x509

Return serial number of given X.509 certificate object.

Function x509-certificate-get-issuer-dn x509

Return issuer DN of given X.509 certificate object as X.509 principal.

Function x509-certificate-get-subject-dn x509

Return subject DN of given X.509 certificate object as X.509 principal.

NOTE: These Issuer DN and Subject DN getters return <x.509-principal> object, however I did not implement any utility for this class, so it's just useless for now.

Function x509-certificate-get-not-before x509

Return start date of given X.509 certificate object.

Function x509-certificate-get-not-after x509

Return end date of given X.509 certificate object.

Function x509-certificate-get-signature x509

Return signature of given X.509 certificate object.

NOTE: This signature is not for verify described below.

Function x509-certificate-get-signature-algorithm x509

Return signature algorithm of given X.509 certificate object as an OID string.

Function x509-certificate-get-public-key x509

Return public key of given X.509 certificate object. The return value is <public-key> described in the section (crypto) - Cryptographic library.

Function verify x509 message signature _

_ :key (verify pkcs1-emsa-v1.5-verify) (hash SHA-1)

message and signature must be bytevector.

Verify given message with signature and x509 certificate.

This procedure uses the verify procedure in (crypto) library. The keyword arguments will be passed to it. For more detail, see (crypto) - Cryptographic library.

Function check-validity x509 :optional (date (current-date))

Validate if the given certificate is valid in given date. Return #t if it's valid, otherwise raises &assertion.