[Cryptography-dev] not_valid_before and not_valid_after as GeneralizedTime

Paul Kehrer paul.l.kehrer at gmail.com
Tue Sep 19 08:25:48 EDT 2017


Right now cryptography attempts to use the logic of RFC 5280 to automatically encode the type of the time. It appears that is insufficient for your needs. I've filed this as https://github.com/pyca/cryptography/issues/3927

-Paul Kehrer (reaperhulk)

On September 19, 2017 at 8:15:11 PM, Fellipe Theophilo (fellipetheophilo at gmail.com) wrote:

Hi everyone,

I need to generate an attribute certificate according to Government's specification law about students identification card that must have not_valid_before and not_valid_after set in GeneralizedTime instead of UTCTime(datetime.datetime object).

Is it possible to do it?


Actually, I tried this:

from pyasn1.type.useful import GeneralizedTime
.not_valid_before(GeneralizedTime('20170101000100Z').asDateTime).not_valid_after(GeneralizedTime('20180331235900Z').asDateTime)

But the time still appear in UTCTime.

Please help
-----
Fellipe
_______________________________________________  
Cryptography-dev mailing list  
Cryptography-dev at python.org  
https://mail.python.org/mailman/listinfo/cryptography-dev  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20170919/e626a32b/attachment.html>


More information about the Cryptography-dev mailing list