Hi!
Can you tell me how to verify wether a timestamp's signature is correct?
I've tryed it in C++ but with no success. I cannot open the signature
file from
http://tsp.iaik.at/tsp (neither in DER nor in PKCS7 format).
Do I need a special conversion to use these files?
I get "bad data" -32 when opening the keyset.
My other question is that what is the proper way to get the timestamping
date from the timestamp envelope? Now I'm extracting the data from byte
66 to byte 79. Is it okay?
Code snippet for attaching the signature for the timestamp check:
CRYPT_CONTEXT cryptContext;
cryptCreateContext( &cryptContext, CRYPT_UNUSED, CRYPT_ALGO_RSA );
cryptPushData(cryptContext,keyfile,filesize(argTSPkeyfile),&bytesCopied);
cryptContext = getTimestampKey(argTSPkeyfile);
cryptSetAttribute( cryptEnvelope,CRYPT_ENVINFO_PUBLICKEY,cryptContext);
cryptDestroyContext( cryptContext );
CRYPT_CONTEXT getTimestampKey(char* keysetFile)
{
CRYPT_KEYSET cryptKeyset;
CRYPT_CONTEXT privKeyContext;
cryptKeysetOpen(&cryptKeyset,CRYPT_UNUSED,CRYPT_KEYSET_FILE,keysetFile,CRYPT_KEYOPT_READONLY)
cryptGetPublicKey(cryptKeyset,&privKeyContext,CRYPT_KEYID_NAME,"[none]");
cryptKeysetClose(cryptKeyset);
return privKeyContext;
}
Thank you!
_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail:
cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlibPosts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.