10.02.2005 15:11:22Enroll в VBS и js Ответов: 0
Погребной Александр
Подскажите в чем может быть неточность. Эта функция на vbs отрабатывает:

Function Req()

CR_IN_BASE64 = &H1
CR_IN_PKCS10 = &H100
CR_IN_KEYGEN = &H200

Dim oCertReq
Dim oEnroll

Set oCertReq = CreateObject("CertificateAuthority.Request")
Set oEnroll = CreateObject("CEnroll.CEnroll")

Dim sDN
sDN = "CN=" + "vba"
sDN = sDN + ",O=" & "1"
sDN = sDN + ",OU=" & "-"
sDN = sDN + ",L=" & "-"
sDN = sDN + ",S=" & "-"
sDN = sDN + ",C=" & "-"
sDN = sDN + ",E=" & "-@-"

Dim sPKCS10
sPKCS10 = oEnroll.createPKCS10( sDN, "1.3.6.1.5.5.7.3.2" )

Dim nDisp
nDisp=oCertReq.Submit(CR_IN_BASE64HEADER Or CR_IN_BASE64, sPKCS10, "", "ca.test.com\ca")

End Function

А эта на js говорит, что RPC сервер недоступен при выполнении Submit:

<script language=javascript>
function req(){
var CR_IN_BASE64HEADER = 0;
var CR_IN_BASE64 = 0x1;
var CR_IN_PKCS10 = 0x100;
var CR_IN_KEYGEN = 0x200;

var oCertReq;
var oEnroll;

oCertReq = new ActiveXObject("CertificateAuthority.Request");
oEnroll = new ActiveXObject("CEnroll.CEnroll.1");

var sDN;
sDN = "CN=" + "js";
sDN = sDN + ",O=" + "-";
sDN = sDN + ",OU=" + "-";
sDN = sDN + ",L=" + "-";
sDN = sDN + ",S=" + "-";
sDN = sDN + ",C=" + "-";
sDN = sDN + ",E=" + "-@-";

var sPKCS10;
sPKCS10 = oEnroll.createPKCS10(sDN, "1.3.6.1.5.5.7.3.2" )

var nDisp;
nDisp=oCertReq.Submit(CR_IN_BASE64HEADER|CR_IN_BASE64, sPKCS10, "", "ca.test.com\ca");
}
</script>