-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: expose 'ClientId' in e2ei methods for credential rotation sinc…
…e the e2ei client identifier differs from the one used in MLS
- Loading branch information
Showing
6 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1647,35 +1647,35 @@ export class CoreCrypto { | |
|
||
/** | ||
* Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI. | ||
* As a consequence, this method does not support changing the ClientId which should remain the same as the Basic one. | ||
* Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation. | ||
* | ||
* @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:[email protected]` | ||
* @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)` | ||
* @param handle user handle e.g. `[email protected]` | ||
* @param expiryDays generated x509 certificate expiry | ||
* @param ciphersuite - for generating signing key material | ||
* @returns The new {@link WireE2eIdentity} object | ||
*/ | ||
async e2eiNewActivationEnrollment(displayName: string, handle: string, expiryDays: number, ciphersuite: Ciphersuite): Promise<WireE2eIdentity> { | ||
const e2ei = await CoreCryptoError.asyncMapErr(this.#cc.e2ei_new_activation_enrollment(displayName, handle, expiryDays, ciphersuite)); | ||
async e2eiNewActivationEnrollment(clientId: string, displayName: string, handle: string, expiryDays: number, ciphersuite: Ciphersuite): Promise<WireE2eIdentity> { | ||
const e2ei = await CoreCryptoError.asyncMapErr(this.#cc.e2ei_new_activation_enrollment(clientId, displayName, handle, expiryDays, ciphersuite)); | ||
return new WireE2eIdentity(e2ei); | ||
} | ||
|
||
/** | ||
* Generates an E2EI enrollment instance for a E2EI client (with a X509 certificate credential) | ||
* having to change/rotate their credential, either because the former one is expired or it | ||
* has been revoked. As a consequence, this method does not support changing neither ClientId which | ||
* should remain the same as the previous one. It lets you change the DisplayName or the handle | ||
* has been revoked. It lets you change the DisplayName or the handle | ||
* if you need to. Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation. | ||
* | ||
* @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:[email protected]` | ||
* @param expiryDays generated x509 certificate expiry | ||
* @param ciphersuite - for generating signing key material | ||
* @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)` | ||
* @param handle user handle e.g. `[email protected]` | ||
* @returns The new {@link WireE2eIdentity} object | ||
*/ | ||
async e2eiNewRotateEnrollment(expiryDays: number, ciphersuite: Ciphersuite, displayName?: string, handle?: string,): Promise<WireE2eIdentity> { | ||
const e2ei = await CoreCryptoError.asyncMapErr(this.#cc.e2ei_new_rotate_enrollment(displayName, handle, expiryDays, ciphersuite)); | ||
async e2eiNewRotateEnrollment(clientId: string, expiryDays: number, ciphersuite: Ciphersuite, displayName?: string, handle?: string,): Promise<WireE2eIdentity> { | ||
const e2ei = await CoreCryptoError.asyncMapErr(this.#cc.e2ei_new_rotate_enrollment(clientId, displayName, handle, expiryDays, ciphersuite)); | ||
return new WireE2eIdentity(e2ei); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1044,30 +1044,30 @@ public class CoreCryptoWrapper { | |
} | ||
|
||
/// Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI. | ||
/// As a consequence, this method does not support changing the ClientId which should remain the same as the Basic one. | ||
/// Once the enrollment is finished, use the instance in ``CoreCrypto/e2eiRotateAll`` to do the rotation. | ||
/// | ||
/// - parameter clientId: client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:[email protected]` | ||
/// - parameter displayName: human readable name displayed in the application e.g. `Smith, Alice M (QA)` | ||
/// - parameter handle: user handle e.g. `[email protected]` | ||
/// - parameter expiryDays: generated x509 certificate expiry | ||
/// - parameter ciphersuite: For generating signing key material. | ||
/// - returns: The new ``CoreCryptoSwift.WireE2eIdentity`` object | ||
public func e2eiNewActivationEnrollment(displayName: String, handle: String, expiryDays: UInt32, ciphersuite: UInt16) async throws -> CoreCryptoSwift.WireE2eIdentity { | ||
return try await self.coreCrypto.e2eiNewActivationEnrollment(displayName: displayName, handle: handle, expiryDays: expiryDays, ciphersuite: ciphersuite) | ||
public func e2eiNewActivationEnrollment(clientId: String, displayName: String, handle: String, expiryDays: UInt32, ciphersuite: UInt16) async throws -> CoreCryptoSwift.WireE2eIdentity { | ||
return try await self.coreCrypto.e2eiNewActivationEnrollment(clientId: clientId, displayName: displayName, handle: handle, expiryDays: expiryDays, ciphersuite: ciphersuite) | ||
} | ||
|
||
/// Generates an E2EI enrollment instance for a E2EI client (with a X509 certificate credential)having to change/rotate | ||
/// their credential, either because the former one is expired or it has been revoked. As a consequence, this method | ||
/// does not support changing neither ClientId which should remain the same as the previous one. It lets you change | ||
/// their credential, either because the former one is expired or it has been revoked. It lets you change | ||
/// the DisplayName or the handle if you need to. Once the enrollment is finished, use the instance in ``CoreCrypto/e2eiRotateAll`` to do the rotation. | ||
/// | ||
/// - parameter clientId: client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:[email protected]` | ||
/// - parameter expiryDays: generated x509 certificate expiry | ||
/// - parameter ciphersuite: For generating signing key material. | ||
/// - parameter displayName: human readable name displayed in the application e.g. `Smith, Alice M (QA)` | ||
/// - parameter handle: user handle e.g. `[email protected]` | ||
/// - returns: The new ``CoreCryptoSwift.WireE2eIdentity`` object | ||
public func e2eiNewRotateEnrollment(expiryDays: UInt32, ciphersuite: UInt16, displayName: String? = nil, handle: String? = nil) async throws -> CoreCryptoSwift.WireE2eIdentity { | ||
return try await self.coreCrypto.e2eiNewRotateEnrollment(expiryDays: expiryDays, ciphersuite: ciphersuite, displayName: displayName, handle: handle) | ||
public func e2eiNewRotateEnrollment(clientId: String, expiryDays: UInt32, ciphersuite: UInt16, displayName: String? = nil, handle: String? = nil) async throws -> CoreCryptoSwift.WireE2eIdentity { | ||
return try await self.coreCrypto.e2eiNewRotateEnrollment(clientId: clientId, expiryDays: expiryDays, ciphersuite: ciphersuite, displayName: displayName, handle: handle) | ||
} | ||
|
||
/// Use this method to initialize end-to-end identity when a client signs up and the grace period is already expired ; that means he cannot initialize with a Basic credential | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters