Platform SDK: Certificate Enrollment Control |
This method adds the name and value pair of an attribute to the request. It is up to the CA to interpret the meaning of the name/value pair.
[Visual Basic] objEnroll.addNameValuePairToSignature( _ Name As String, _ Value As String) [C++] HRESULT addNameValuePairToSignature( BSTR Name, // in BSTR Value // in );
[Visual Basic] None.
[C++] The return value is an HRESULT, with S_OK returned if the call is successful.
Use this function to add attributes to the request.
BSTR bstrName = NULL; BSTR bstrValue = NULL; HRESULT hr; // allocate BSTR for the name bstrName = SysAllocString(TEXT(szOID_COUNTRY_NAME)); // alternatively,bstrName = SysAllocString(L"2.5.4.6"); // allocate BSTR for the value bstrValue = SysAllocString(L"US"); // add the Name/Value pair to the signature // pEnroll is previously instantiated ICEnroll2 interface pointer hr = pEnroll->addNameValuePairToSignature( bstrName, bstrValue ); if ( FAILED( hr ) ) printf("Failed addNameValuePairToSignature - %x\n", hr ); else printf("addNameValuePairToSignature(%ws, %ws) succeeded\n", bstrName, bstrValue ); // free BSTRs if ( NULL != bstrName ) SysFreeString( bstrName ); if ( NULL != bstrValue ) SysFreeString( bstrValue );
' declare Certificate Enrollment Control object Dim objXen As Object ' variables for Name and Value Dim strName As String Dim strValue As String ' instantiate the object Set objXen = CreateObject("CEnroll.CEnroll.1") ' add the name/value pair to the signature ' in this case, for the Country/Region name strName = "2.5.4.6" strValue = "US" objXen.addNameValuePairToSignature strName, strValue
Windows NT/2000: Requires Windows 2000.
Header: Declared in Xenroll.h.
Library: Use Uuid.lib.