atecc508a v0.1.0 ATECC508A.Validity

Handle the ATECC508’s encoded dates

Link to this section Summary

Functions

Convenience function for compressing issue date/expiration tuples

Compress an issue date/expiration to a bitstring

Create a compatible date range for X.509 certificates that need to be compressed

Decompress an issue date/expiration bitstring

Check that the specified dates can be represented in a compressed certificate

Link to this section Functions

Convenience function for compressing issue date/expiration tuples

Link to this function compress(issue_date, expire_date)

Compress an issue date/expiration to a bitstring

This function can easily lose precision on the dates and times since so little is encoded. If accepting arbitrary datetimes, you’ll want to check that the conversion didn’t truncate in strange ways.

Important: the max issue year is 2031!!

Link to this function create_compatible_validity(years)
create_compatible_validity(non_neg_integer()) :: {DateTime.t(), DateTime.t()}

Create a compatible date range for X.509 certificates that need to be compressed.

Decompress an issue date/expiration bitstring

Link to this function valid_dates?(issue_date, expire_date)

Check that the specified dates can be represented in a compressed certificate.