ATECC508A.Validity (atecc508a v0.3.0) View Source
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
Specs
compress({DateTime.t(), DateTime.t()}) :: ATECC508A.encoded_dates()
Convenience function for compressing issue date/expiration tuples
Specs
compress(DateTime.t(), DateTime.t()) :: ATECC508A.encoded_dates()
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!!
Specs
create_compatible_validity(non_neg_integer()) :: {DateTime.t(), DateTime.t()}
Create a compatible date range for X.509 certificates that need to be compressed.
Specs
decompress(ATECC508A.encoded_dates()) :: {DateTime.t(), DateTime.t()}
Decompress an issue date/expiration bitstring
Check that the specified dates can be represented in a compressed certificate.