PeerIdentityExport (Windows CE 5.0)

Send Feedback

This function allows a user to export one peer identity. The user can then transfer the peer identity to a different computer.

HRESULT WINAPI PeerIdentityExport(  PCWSTR pwzIdentity,  PCWSTR pwzPassword,  PCWSTR* ppwzExportXML);

Parameters

  • pwzIdentity
    [in] Specifies the peer identity to export. This parameter is required and does not have a default value.
  • pwzPassword
    [in] Specifies the password to use to encrypt the peer identity. This parameter cannot be NULL. This password must also be used to import the peer identity, or the import operation fails.
  • ppwzExportXML
    [out] Receives a pointer to the exported peer identity in XML format. If the export operation is successful, the application must free ppwzExportXML by calling PeerFreeData.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function call succeeded.
E_INVALIDARG One of the parameters is not valid.
E_OUTOFMEMORY There is not enough memory to perform the specified operation.
PEER_E_NO_KEY_ACCESS Access to the peer identity or peer-to-peer group keys was denied. This is typically caused by an incorrect access control list (ACL) for the folder that contains the user or computer keys. This can happen when the ACL has been manually reset.
PEER_E_NOT_FOUND A peer identity that matches the specified name cannot be found.

Remarks

Peer-to-peer group membership credentials are not exported. Only one peer identity is exported. An exported peer identity can be imported on another computer by using PeerIdentityImport.

Exporting a peer identity does not remove it from a local computer. Instead, it makes a copy of it. The copy can be used to backup and restore a peer identity.

The following XML code example shows how PeerIdentityExport encodes the peer name for export:

<PEERIDENTITYEXPORT VERSION="1.0">
  <IDENTITY>
    <!-- UTF-8 encoded peer name of the identity -->
  </IDENTITY>
  <IDENTITYDATA xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">
    <!-- base64 encoded / PFX encoded and encrypted IDC with the private key -->
  </IDENTTYDATA>
</PEERIDENTITYEXPORT>

Requirements

OS Versions: Windows CE 5.0 and later.
Header: p2p.h.
Link Library: p2p.lib.

See Also

Identity Manager Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.