Re: correct steps to create X.509 cert
- From: "Haitao Li" <lht1999 [at] hotmail.com>
- Date: Thu, 10 May 2007 12:42:59 -0700
I ran your script again and one problem is that it does not install the new certificate so you won't see it in certificate manager snap-in. But I am not sure if this is related to your problems. The follow scripts generates a new certificate and put it in *Intermediate CA* store. You will need to manually move it back to "my" store. I haven't found a solution to that, and it could be a bug in the enrollment COM component.
var CommonName="cn=my name";
var KeyUsage = 4; //CERT_KEY_CERT_SIGN_KEY_USAGE
//CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80
//CERT_NON_REPUDIATION_KEY_USAGE 0x40
//CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20
//CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10
//CERT_KEY_AGREEMENT_KEY_USAGE 0x08
//CERT_KEY_CERT_SIGN_KEY_USAGE 0x04
//CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x02
//CERT_CRL_SIGN_KEY_USAGE 0x02
//CERT_ENCIPHER_ONLY_KEY_USAGE 0x01
var req = new ActiveXObject("X509Enrollment.CX509CertificateRequestCertificate");
req.Initialize(1); //ContextUser
req.PrivateKey.ProviderName="Microsoft Base Cryptographic Provider v1.0";
req.PrivateKey.Length = 1024;
var ext = new ActiveXObject("X509Enrollment.CX509ExtensionKeyUsage");
ext.InitializeEncode(KeyUsage);
name = new ActiveXObject("X509Enrollment.CX500DistinguishedName");
name.Encode(CommonName);
req.Subject = name;
req.X509Extensions.Add(ext);
req.Encode();
var cert = req.RawData(0);
var enrollment = new ActiveXObject("X509Enrollment.CX509Enrollment");
enrollment.Initialize(1);
enrollment.InstallResponse(7, cert, 0, "");
"Haitao Li" <lht1999 [at] hotmail.com> wrote in message news:74E0F92E-0A10-470E-A6E3-339B69F59DA0@xxxxxxxxxxxxxxxx
I'll try if you tell me what your problem is..
"prueba prueba" <imrc@xxxxxxxxxxx> wrote in message news:78c6640850d1402ab5b647dd4d5a2e3a@xxxxxxxxxxxxxxThis code doesn't works with Vista, I have several problems with the objects.
Can you help me?
(short25@xxxxxxxxxxx)
- References:
- Re: correct steps to create X.509 cert
- From: prueba prueba
- Re: correct steps to create X.509 cert
- Prev by Date: EditSecurity, ISecurityInformation and Acl Inheritance question
- Next by Date: Importing a x509 certificate with only a public key
- Previous by thread: Re: correct steps to create X.509 cert
- Next by thread: EditSecurity, ISecurityInformation and Acl Inheritance question
- Index(es):
Relevant Pages
|
|