<div class="content"><p>This method is invoked by the requestor to create a VSC with
attestation.</p><dl>
<dd>
<div><pre> HRESULT CreateVirtualSmartCardWithAttestation(
         [in, string] const wchar_t* pszFriendlyName,
         [in] unsigned char bAdminAlgId,
         [in, size_is(cbAdminKey)] const unsigned char* pbAdminKey,
         [in] unsigned long cbAdminKey,
         [in, unique, size_is(cbAdminKcv)] const unsigned char* pbAdminKcv,
         [in] unsigned long cbAdminKcv,
         [in, unique, size_is(cbPuk)] const unsigned char* pbPuk,
         [in] unsigned long cbPuk,
         [in, size_is(cbPin)] const unsigned char* pbPin,
         [in] unsigned long cbPin,
         [in, unique, size_is(cbPinPolicy)] const unsigned char* pbPinPolicy,
         [in] unsigned long cbPinPolicy,
         [in] TPMVSC_ATTESTATION_TYPE attestationType,
         [in] int fGenerate,
         [in, unique] ITpmVirtualSmartCardManagerStatusCallback* pStatusCallback,
         [out, string] wchar_t** ppszInstanceId
 );
  
</pre></div>
</dd></dl><p><b>pszFriendlyName: </b>A Unicode string for use in
any user interface messages relating to this VSC.</p><p><b>bAdminAlgId: </b>An unsigned byte value. This
parameter MUST be set to 0x82.</p><p><b>pbAdminKey: </b>An array of 24 bytes containing a
TDEA <a href="https://go.microsoft.com/fwlink/?LinkId=131225" data-linktype="external">[SP800-67]</a>
key intended to be used as the administrative key for the new VSC.</p><p><b>cbAdminKey: </b>A 32-bit unsigned integer value.
It MUST be set to 24.</p><p><b>pbAdminKcv: </b>An array of bytes containing the
Key Check Value (KCV) for the administrative key contained in the pbAdminKey
parameter. This parameter is optional and MUST be set to NULL if absent. If
present, it MUST be computed by encrypting eight zero bytes using the TDEA
[SP800-67] block cipher and taking the first three bytes.</p><p><b>cbAdminKcv: </b>A 32-bit unsigned integer value.
It MUST be set to 0 if the pbAdmin parameter is NULL, and MUST be set to 3
otherwise.</p><p><b>pbPuk: </b>An array of bytes containing the
desired PUK for the new VSC. This parameter is optional and MUST be set to NULL
if absent. If present, its length MUST be between 8 and 127 bytes, inclusive.</p><p><b>cbPuk: </b>A 32-bit unsigned integer value. It
MUST be equal to the length of the pbPuk parameter in bytes. If pbPuk is NULL,
this parameter MUST be set to 0.</p><p><b>pbPin: </b>An array of bytes containing the
desired PIN for the new VSC. Its length MUST be between 4 and 127 bytes,
inclusive.</p><p><b>cbPin: </b>A 32-bit unsigned integer value. It
MUST be equal to the length of the pbPin parameter in bytes.</p><p><b>pbPinPolicy: </b>A PinPolicySerialization
structure specifying the PIN policy for the new VSC, as described in section <a href="ffcc719e-2468-44e7-aedf-a15ca08a5df2" data-linktype="relative-path">2.2.2.1</a>.</p><p><b>cbPinPolicy: </b>A 32-bit unsigned integer value.
It MUST be equal to the length in bytes of the pbPinPolicy parameter.</p><p><b>attestationType: </b>A TPMVSC_ATTESTATION_TYPE
value specifying the desired attestation properties of the new VSC.</p><p><b>fGenerate: </b>A Boolean value that indicates
whether a file system is to be generated on the new VSC.</p><p><b>pStatusCallback: </b>A reference to an instance of
the ITpmVirtualSmartCardManagerStatusCallback DCOM interface on the requestor.
The server uses this interface to provide feedback on progress and errors. This
parameter is optional and MUST be set to NULL if absent.</p><p><b>ppszInstanceId: </b>A Unicode string containing a
unique instance identifier for the VSC created by this operation.</p><p><b>Return Values: </b>The server MUST return 0 if it
successfully creates the new VSC, and a nonzero value otherwise.</p><p><b>Exceptions Thrown: </b>No exceptions are thrown
beyond those thrown by the underlying RPC protocol <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p><p>The server MUST validate the parameters before executing the
requested operation, using the validation rules specified in section <a href="3bd5c84c-b434-4a78-ad74-6c093355fb0a" data-linktype="relative-path">3.1.4.1</a>, and fail requests
with invalid parameters.</p><p>If pbPinPolicy is present, the server MUST validate that it
is exactly 32 bytes in size and conforms to the format specified in section
2.2.2.1. The server MUST fail the requested operation if any of the following
is TRUE:</p><ul><li><p><span><span> 
</span></span>minLength is not between 4 and 127, inclusive.</p>
</li><li><p><span><span> 
</span></span>maxLength is not between 4 and 127, inclusive.</p>
</li><li><p><span><span> 
</span></span>maxLength is not greater than or equal to minLength.</p>
</li><li><p><span><span> 
</span></span>The value of uppercaseLettersPolicyOption is not a valid member
of the SmartCardPinCharacterPolicyOption enumerated type.</p>
</li><li><p><span><span> 
</span></span>The value of lowercaseLettersPolicyOption is not a valid member
of the SmartCardPinCharacterPolicyOption enumerated type.</p>
</li><li><p><span><span> 
</span></span>The value of digitsPolicyOption is not a valid member of the
SmartCardPinCharacterPolicyOption enumerated type.</p>
</li><li><p><span><span> 
</span></span>The value of specialCharactersPolicyOption is not a valid member
of the SmartCardPinCharacterPolicyOption enumerated type.</p>
</li><li><p><span><span> 
</span></span>The value of otherCharactersPolicyOption is not a valid member of
the SmartCardPinCharacterPolicyOption enumerated type.</p>
</li></ul><p>After validating these conditions, the server MUST proceed
to create the VSC and notify the client of progress through the callback
interface as specified in section 3.1.4.1. The server MUST also initialize the
appropriate data structures for the VSC in accordance with the PIN policy
specified by the caller.</p></div>