PeerNameType PeerNameType PeerNameType PeerNameType Enum


定义要创建的 PeerName 的类型。 对等名称可以是安全的,也可以是不安全的。A peer name is either secured or unsecured. 安全的对等名称提供名称所有权证明。A secured peer name provides a proof of ownership of the name. 不安全的对等名称没有关联的标识。An unsecured peer name has no identity associated.

public enum class PeerNameType
public enum PeerNameType
type PeerNameType = 
Public Enum PeerNameType


Secured Secured Secured Secured 0

使用当前用户的标识创建一个安全的 PeerNameCreate a secured PeerName using the identity of current user.

Unsecured Unsecured Unsecured Unsecured 1

使用当前用户的标识创建一个不安全的 PeerNameCreate an unsecured PeerName using the identity of current user.


节点必须有权访问公共密钥,与关联的私钥在创建受保护时使用PeerName,以便在证明所有权。A node must have access to the private key associated with the public key, used in creating the secured PeerName, in order to prove ownership. 节点不具有公共键关系。The node does not have a relationship to a public key.

对等名称的格式为: Authority.ClassifierThe format of a peer name is: Authority.Classifier. Authority取决于名称是安全的对等名称或不安全的对等名称。The value of Authority depends on whether the name is a secured peer name or an unsecured peer name. Classifier可以为任何字符串,包含 15 个或更少的 Unicode 字符,包括设置名称的一部分null终止符。The Classifier part of the name can be set to any string that contains 15 or fewer Unicode characters, including the null terminator. 一次AuthorityClassifier并且建立了对等方的安全级别,对等方还为具有相对名称或主机名引用。Once the Authority, Classifier and security level of a peer have been established, a peer can also be referred to with a relative name or a host name.

只有所有者或对等主机,可以注册使用的安全对等名称PNRP Namespace 提供程序 APIOnly the owner, or peer host, can register a secure peer name with the PNRP Namespace Provider API. 任何节点都可以声明所有权转让给任何不安全PeerNameAny node can claim ownership to any unsecured PeerName.

请注意使用的安全PeerName不能确保网络应用程序的整体安全性。Note Using a secured PeerName does not ensure the overall security of a networking application. 应用程序的安全性是视具体实现而定的。Security of the application is implementation-dependent.