mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
75 lines
2.6 KiB
Protocol Buffer
75 lines
2.6 KiB
Protocol Buffer
// Copyright 2023 Google LLC
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
syntax = "proto3";
|
|
|
|
package nearby.internal;
|
|
|
|
// option cc_api_version = 2;
|
|
// option java_api_version = 2;
|
|
option java_multiple_files = true;
|
|
option java_package = "com.google.nearby.presence";
|
|
option java_outer_classname = "CredentialProto";
|
|
option optimize_for = LITE_RUNTIME;
|
|
|
|
enum IdentityType {
|
|
IDENTITY_TYPE_UNSPECIFIED = 0;
|
|
IDENTITY_TYPE_PRIVATE = 1;
|
|
IDENTITY_TYPE_TRUSTED = 2;
|
|
IDENTITY_TYPE_PUBLIC = 3;
|
|
IDENTITY_TYPE_PROVISIONED = 4;
|
|
}
|
|
|
|
// The shared credential is derived from local credential, and distributed to
|
|
// remote devices based on the trust token for identity decryption and
|
|
// authentication.
|
|
message SharedCredential {
|
|
// The randomly generated unique id of the public credential.
|
|
bytes secret_id = 1;
|
|
|
|
// 32 bytes of secure random bytes used to derive any symmetric keys needed.
|
|
bytes key_seed = 2;
|
|
|
|
// The time in millis from epoch when this credential becomes effective.
|
|
int64 start_time_millis = 3;
|
|
|
|
// The time in millis from epoch when this credential expires.
|
|
int64 end_time_millis = 4;
|
|
|
|
// The encrypted Metadata in bytes. Encrypted either by the v0 or v1
|
|
// metadata_encryption_key.
|
|
bytes encrypted_metadata_bytes = 5;
|
|
|
|
// The tag for verifying metadata_encryption_key.
|
|
bytes metadata_encryption_key_tag = 6;
|
|
|
|
// The public key is used to create a secure connection with the device.
|
|
bytes connection_signature_verification_key = 7;
|
|
|
|
// The public key is used to verify Advertisement Signature in BT5.0 (v1)
|
|
// specs.
|
|
bytes advertisement_signature_verification_key = 8;
|
|
|
|
// The trust type assigned to the credential. The credential is only
|
|
// accessible to contacts assigned with the same token. This field is only
|
|
// visible to the generating device and the server for distribution/provision
|
|
// purposes. Tokens are abstracted (with unnecessary details being removed)
|
|
// when returned to downloading devices.
|
|
IdentityType identity_type = 9;
|
|
|
|
// The version number of this SharedCredential, matches the corresponding
|
|
// protocol version.
|
|
bytes version = 10;
|
|
}
|