Re: how to export pfx programmatically



On Mar 14, 12:19 pm, balakrishnan.din...@xxxxxxxxx wrote:
hi frnds,

I want to import pfx to browser , I have used CAPICOM
property , Store.Load, but it not working ,

<script language="VBScript">'Option Explicit
const CAPICOM_LOCAL_MACHINE_STORE = 1
const CAPICOM_CURRENT_USER_STORE = 2
const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3
const CAPICOM_SMART_CARD_USER_STORE = 4
const CAPICOM_STORE_OPEN_READ_ONLY = 0
const CAPICOM_STORE_OPEN_READ_WRITE = 1
const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2
const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128
const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256
const CAPICOM_KEY_SPEC_KEYEXCHANGE = 1
const CAPICOM_KEY_SPEC_SIGNATURE = 2
const CAPICOM_CA_STORE = "CA"
const CAPICOM_MY_STORE = "MY"
const CAPICOM_ADDRESS_BOOK_STORE = "AddressBook"
const CAPICOM_OTHER_STORE = "other"
const CAPICOM_ROOT_STORE = "root"
const CRYPT_EXPORTABLE = 1
const CRYPT_STRING_BASE64HEADER= 0
const CAPICOM_KEY_STORAGE_EXPORTABLE = 1
const CAPICOM_KEY_STORAGE_FLAG = 0
Dim st,fso,out,szReq,privatekey,temp,test

Set st = CreateObject("CAPICOM.Store")
st.Open CAPICOM_CURRENT_USER_STORE,
"MY" ,CAPICOM_STORE_OPEN_READ_WRITE
st.Load "c:\\Desktop
\AdminL1.cer","odyssey",CAPICOM_KEY_STORAGE_FLAG.CAPICOM_KEY_STORAGE_EXPORT­ABLE
st.Load
"AdminL1.p12","odyssey",CAPICOM_KEY_STORAGE_FLAG.CAPICOM_KEY_STORAGE_EXPORT­ABLE

</script>

,Can anyone tell whts wrong in it, Or if u have sample working code
for Installing pfx, it will be more useful for me, waiting for ur
reply, thanks in Advance

Rgrds
Dinesh

The MSDN docs for Store .Load at http://msdn2.microsoft.com/en-us/library/aa388127.aspx
clearly states:

This method raises CAPICOM_E_NOT_ALLOWED when it is scripted
from a Web-based application.


.



Relevant Pages

  • how to export pfx programmatically
    ... I want to import pfx to browser, I have used CAPICOM ... const CRYPT_STRING_BASE64HEADER= 0 ...
    (microsoft.public.platformsdk.security)
  • Re: how to use CAPICOM.Certificate.Save()
    ... I need to Export a PFX from the browser, ... But i dont know what ... The parameters and usage of Certificate.Save are detailed at ...
    (microsoft.public.platformsdk.security)

Loading