Export (0) Print
Expand All

PeerIdentityExport function

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

Syntax


HRESULT WINAPI PeerIdentityExport(
  _In_   PCWSTR pwzIdentity,
  _In_   PCWSTR pwzPassword,
  _Out_  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 value

If the function call succeeds, the return value is S_OK. Otherwise, it returns one of the following values.

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

The specified peer identity does not exist.

 

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 ccmputer, it makes a copy of it. The copy can be used to backup and restore a peer identity.

The XML fragment used by PeerIdentityExport is as follows:

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

Requirements

Minimum supported client

Windows XP with SP2 [desktop apps only]

Minimum supported server

None supported

Version

Windows XP with SP1 with the Advanced Networking Pack for Windows XP

Header

P2P.h

Library

P2P.lib

DLL

P2P.dll

See also

PEER_DATA
PeerFreeData
PeerIdentityImport

 

 

Community Additions

ADD
Show:
© 2014 Microsoft