问题
I want to encrypt and decrypt the data on client-side for that i am using SJCL library, but i want my key to be expired after a scheduled time , so my question here is -
is it possible to generate such a key while using SJCL(or any other library may be) ,
if yes how? provided that the key must be demolished on the client side only without any server interaction?
any help is greatly appreciated. thanks
回答1:
No, outside help of a third party (keeping the key) or normal programming techniques (i.e. wiping the key using a timer) there is no key that has such an intrinsic time out.
Certificates have a validity period though. With such a certificate it is possible to sign messages, adding the certificate to the signed message. You then only accept those messages whose certificate has not expired. In other words, the key itself will still be available, but it has become useless.
For this use either the PGP or CMS container formats, which are able to store the certificates as well as the data and the signature. The data may be encrypted as well.
来源:https://stackoverflow.com/questions/22981235/generate-a-key-for-sjcl-that-expires-automatically-after-a-period-of-time