Partager via


Importing and Exporting a Peer Identity (Windows CE 5.0)

Send Feedback

Peer identity files can be imported and exported from one endpoint to another by using the identity import and export functions provided by the Identity Manager. These functions allow a user to quickly and conveniently export identity information from one computer to another computer.

To export the identity data of a peer, call the PeerIdentityExport function and pass the identity name to export and a password used to encrypt the associated credentials. This function returns an XML string that contains the identity name of the peer and the encrypted credentials for that specific identity. These can then be passed to a different computer by using an external transfer mechanism such as e-mail.

Note   When calling PeerIdentityExport, the application or API user must provide a strong password of sufficient length. This is important because the imported identity data contains the private key for the identity.

The following code example shows the format of the XML string:

<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>

To retrieve the exported identity data, call the PeerIdentityImport function and pass the XML string with the password passed in the previous call to PeerIdentityExport. PeerIdentityImport returns the peer name of the imported identity. The imported identity name and credentials can be used just like an identity name returned by PeerEnumIdentities or PeerIdentityCreate.

See Also

Peer-to-Peer Application Development

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.