I am using CAPICOM on Windows2003 platform.
I was able to sign a document with relevent certificate but now
I am not able to do so. The error thrown is 'Invalid Handle' or
Error Type:
(0x80090016)
Keyset does not exist
/sign/signdatademo.asp, line 280
What might be the reason? The certificate access are correctly set.
Code snippet is below
Set Store = Server.CreateObject("CAPICOM.Store")
Store.Open CAPICOM_LOCAL_MACHINE_STORE, "MY" ,0
Set Certificates = Store.Certificates.Find
(CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME, SubjectName)
' Response.Write("<br>Certificate found: " & Certificates.Count & "
cert Details : " & Certificates(1).SubjectName)
'response.end
Set Signer = Server.CreateObject("CAPICOM.Signer")
Signer.Certificate = Certificates(1)
Signer.Options = 0
Set Certificates = Nothing
Set Store = Nothing
'Following 4 lines were added on 14 Apr 2004
set SigningTime = server.CreateObject("CAPICOM.Attribute")
'SigningTime.Name = CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME
SigningTime.Name = 0
SigningTime.Value = Now
Signer.AuthenticatedAttributes.Add SigningTime
Set SignedData = CreateObject("CAPICOM.SignedData")
SignedData.Content = DataToSign
Message = SignedData.Sign(Signer, True, CAPICOM_ENCODE_BASE64)
What should I do ?
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/