Error while proccessing certificate.Load

  • Thread starter balakrishnan.dinesh
  • Start date
B

balakrishnan.dinesh

hi,

Im getting a Error while importing a PFX using Certificate.Load
method

My code is VBscript

const CAPICOM_KEY_STORAGE_EXPORTABLE=1
const CAPICOM_KEY_STORAGE_FLAG=1
const CAPICOM_KEY_STORAGE_DEFAULT=1
const CAPICOM_KEY_LOCATION=1
const CAPICOM_CURRENT_USER_KEY=1

Set st = CreateObject("CAPICOM.Store")
st.Open CAPICOM_CURRENT_USER_STORE,"MY",CAPICOM_STORE_OPEN_READ_WRITE

For Each Certificate In st.Certificates
certificate.Load("c:\1.pfx", password,
CAPICOM_KEY_STORAGE_FLAG.CAPICOM_KEY_STORAGE_DEFAULT,
CAPICOM_KEY_LOCATION.CAPICOM_CURRENT_USER_KEY);
exit for

This is my script. So while importing It displaying a Script Error as
Object Identifier : [number: 1] in certificate.load line

Can anyone tellme , what will be the problem, and what ll be the
solution , or any other sample code for importing certificate is
there, plz send me that

Rgrds
Dinesh
 
I

ilan.carmon

Hi,

I have a little different problem than you. I am trying to
automatically import Certificates using VBscript and every time I call
the function Store.Load or Store.Add , I receive "Access is Denied".
From other messages here and MSDN docs its looks like that Web based
scripts cannot call this function (probably due to security) and
VBScript is web based scripting language. But maybe I am wrong...

(e-mail address removed) כתב:
hi,

Im getting a Error while importing a PFX using Certificate.Load
method

My code is VBscript

const CAPICOM_KEY_STORAGE_EXPORTABLE=1
const CAPICOM_KEY_STORAGE_FLAG=1
const CAPICOM_KEY_STORAGE_DEFAULT=1
const CAPICOM_KEY_LOCATION=1
const CAPICOM_CURRENT_USER_KEY=1

Set st = CreateObject("CAPICOM.Store")
st.Open CAPICOM_CURRENT_USER_STORE,"MY",CAPICOM_STORE_OPEN_READ_WRITE

For Each Certificate In st.Certificates
certificate.Load("c:\1.pfx", password,
CAPICOM_KEY_STORAGE_FLAG.CAPICOM_KEY_STORAGE_DEFAULT,
CAPICOM_KEY_LOCATION.CAPICOM_CURRENT_USER_KEY);
exit for

This is my script. So while importing It displaying a Script Error as
Object Identifier : [number: 1] in certificate.load line

Can anyone tellme , what will be the problem, and what ll be the
solution , or any other sample code for importing certificate is
there, plz send me that

Rgrds
Dinesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top