mirror of
https://github.com/signalapp/libsignal.git
synced 2026-05-02 20:42:24 +02:00
This is a variant of AuthCredential that carries two UUIDs, intended to be a user's ACI and PNI. Why? Because when you've been invited to a group, you may have been invited by your ACI or by your PNI, or by both, and it's easier for clients to treat all those states the same by having a credential that covers both identities. The downside is that it's larger (both the data, obviously, but also the zkgroup proof of validity, unsurprisingly). AnyAuthCredentialPresentation gains a 'get_pni_ciphertext' method, which will return `None` for the existing presentations and `Some(encrypted_pni)` for the new credential. Having a separate credential type but a common presentation type makes it easier for the server to handle all possible credentials uniformly.
14 lines
343 B
Swift
14 lines
343 B
Swift
//
|
|
// Copyright 2022 Signal Messenger, LLC.
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
//
|
|
|
|
import Foundation
|
|
import SignalFfi
|
|
|
|
public class AuthCredentialWithPniResponse: ByteArray {
|
|
public required init(contents: [UInt8]) throws {
|
|
try super.init(contents, checkValid: signal_auth_credential_with_pni_response_check_valid_contents)
|
|
}
|
|
}
|