2.2.3.1 Encoded CPA

The Encoded CPA structure contains information about an endpoint.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

CPA Length

Cpa MinorVersion

Cpa MajorVersion

PnrpMinorVersion

PnrpMajorVersion

00

X

F

C

A

U

R

Reserved

Not After

...

Service Location (16 bytes)

...

...

Nonce (16 bytes)

...

...

BinaryAuthority (20 bytes, optional)

...

...

ClassifierHash (20 bytes, optional)

...

...

FriendlyName Len (optional)

FriendlyName (variable)

...

Service Address List (variable)

...

NumPayloads

Total Bytes

Payload (variable)

...

Public Key (variable)

...

Signature (variable)

...

CPA Length (2 bytes): The total number, in little-endian byte order, of bytes in the Encoded CPA structure.

Cpa MinorVersion (1 byte): The minor version of the Encoded CPA structure. MUST be set to 0x00.

Cpa MajorVersion (1 byte): The major version of the Encoded CPA structure. MUST be set to 0x02.

PnrpMinorVersion (1 byte): The minor version of PNRP that constructed the CPA. MUST be set to 0x00.

PnrpMajorVersion (1 byte): The major version of PNRP that constructed the CPA. MUST be set to 0x04.

00 (2 bits): MUST be set to zero when sent and MUST be ignored on receipt

X (1 bit): If set, indicates the CPA has an associated Extended Payload.

F (1 bit): If set, indicates the CPA contains the FriendlyNameLen and FriendlyName fields.

C (1 bit): If set, indicates the CPA contains a ClassifierHash field. Either the A bit or the C bit (or both) MUST be set.

A (1 bit): If set, indicates the CPA contains a BinaryAuthority field.

U (1 bit): If set, indicates the FriendlyName field is encoded as UTF-8 [RFC2279] instead of Unicode. This bit MUST be set to 0 if F is 0.

R (1 bit): If set, indicates that this is a Revoke CPA. That is, it indicates an ID registered at a node is being unregistered.

Reserved (1 byte): MUST be set to zero when sent and MUST be ignored on receipt

Not After (8 bytes): The number, in little-endian byte order, of 100-nanosecond intervals since January 1, 1601 (UTC), after which the CPA expires. The value SHOULD be from 12 hours in the future up to one week in the future.

Service Location (16 bytes): A service location, with the least significant byte first.

Nonce (16 bytes): If the R flag is set, this MUST be zero. If the R flag is clear, this MUST be the value of the Nonce field from the INQUIRE message that caused this Encoded CPA structure to be constructed.

BinaryAuthority (20 bytes): If present, a 160-bit binary representation of the authority, with the least significant byte first. For Secure Peer Names, the BinaryAuthority MUST be a 160-bit SHA-1 [RFC3174] hash of the PublicKey Data field of the CPA Public Key structure in the Public Key field. For Unsecured Peer Names, the BinaryAuthority field MUST NOT be present. Its presence is specified by the A flag.

ClassifierHash (20 bytes): If a classifier is present, this field MUST contain a 160-bit SHA-1 hash of the classifier text. Its presence is specified by the C flag.

FriendlyName Len (2 bytes): If present, the count, in little-endian byte order, of bytes in the FriendlyName field. Its presence is specified by the F flag. If present, it MUST be in the range 1 to 78.

FriendlyName (variable): A human-readable label identifying the PNRP ID. The FriendlyName field's presence is specified by the F flag. If present, this MUST be a non-NULL-terminated string, either Unicode or UTF-8 [RFC2279], depending on the value of the U flag.

Service Address List (variable): A Service Address List structure.

NumPayloads (2 bytes): The number, in little-endian byte order, of payloads that follow this field. MUST be in the range 0 to 1, inclusive. A Revoke CPA (for example, a CPA with the R flag set) SHOULD have 0 payloads.

Total Bytes (2 bytes): The number, in little-endian byte order, of bytes in the NumPayloads, TotalBytes, and Payload fields. MUST be in the range 4 to 210, inclusive.

Payload (variable): A PAYLOAD structure containing application-supplied data. The length of PAYLOAD MUST NOT exceed 206 bytes.

Public Key (variable): A CPA Public Key (section 2.2.3.1.4) structure.

Signature (variable): A SIGNATURE structure.