Platform SDK: Certificate Enrollment Control |
The acceptFilePKCS7 method accepts and processes a PKCS #7 containing a certificate. The PKCS #7 is stored in a file, whose name is the parameter to this method. This method differs from acceptPKCS7 only in using a file as a container for the certificate.
[Visual Basic] objEnroll.acceptFilePKCS7( wszPKCS7FileName As String ) [C++] HRESULT acceptFilePKCS7 ( BSTR wszPKCS7FileName // in );
[Visual Basic] None.
[C++] The return value is an HRESULT. A value of S_OK indicates success. Upon successful completion of this function, the PKCS7 in the file will be accepted.
By default, the system stores MY, CA, ROOT, and REQUEST are used to store the certificates. However, you can specify other stores by assigning the following properties before calling this method:
HRESULT hr; BSTR bstrFileName; // Allocate a BSTR referencing an existing file. bstrFileName = SysAllocString(TEXT("myPKCS7.fil")); // pEnroll is a previously instantiated ICEnroll interface pointer. hr = pEnroll->acceptFilePKCS7( bstrFileName ); if (FAILED(hr)) printf("Failed acceptFilePKCS7 - %x\n", hr ); else printf("Accepted PKCS7 from file %ws successfully\n", bstrFileName ); // Free BSTR when done. if ( NULL != bstrFileName ) SysFreeString(bstrFileName);
Dim strFileName As String strFileName = "myPKCS7.fil" On Error GoTo Err_Accept objEnroll.acceptFilePKCS7 (strFileName) MsgBox ("Accepted PKCS7 from " & _ strFileName & _ " successfully") Exit Sub Err_Accept: MsgBox ("Failed acceptFilePKCS7" & _ " from file " & _ strFileName) End Sub
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with the Windows NT 4.0 Option Pack).
Header: Declared in Xenroll.h.
Library: Use Uuid.lib.
acceptPKCS7, CAStoreName, MyStoreName, RootStoreName, RequestStoreName