@wireapp/core-crypto 9.3.3 → 9.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,14 +2,18 @@
2
2
 
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
+ /**
6
+ * Get an instance of the default ciphersuite.
7
+ */
8
+ export function ciphersuiteDefault(): Ciphersuite;
5
9
  /**
6
10
  * Construct a ciphersuite enum instance from its discriminant.
7
11
  */
8
12
  export function ciphersuiteFromU16(discriminant: number): Ciphersuite;
9
13
  /**
10
- * Get an instance of the default ciphersuite.
14
+ * Open or create a [Database].
11
15
  */
12
- export function ciphersuiteDefault(): Ciphersuite;
16
+ export function openDatabase(name: string, key: DatabaseKey): Promise<Database>;
13
17
  /**
14
18
  * Updates the key of the CoreCrypto database.
15
19
  * To be used only once, when moving from CoreCrypto <= 5.x to CoreCrypto 6.x.
@@ -19,10 +23,6 @@ export function migrateDatabaseKeyTypeToBytes(path: string, old_key: string, new
19
23
  * Updates the key of the CoreCrypto database.
20
24
  */
21
25
  export function updateDatabaseKey(name: string, old_key: DatabaseKey, new_key: DatabaseKey): Promise<void>;
22
- /**
23
- * Open or create a [Database].
24
- */
25
- export function openDatabase(name: string, key: DatabaseKey): Promise<Database>;
26
26
  /**
27
27
  * MLS ciphersuites.
28
28
  */
@@ -282,14 +282,14 @@ export class BuildMetadata {
282
282
  export class ClientId {
283
283
  free(): void;
284
284
  [Symbol.dispose](): void;
285
- /**
286
- * Instantiate a client id from a byte array.
287
- */
288
- constructor(bytes: Uint8Array);
289
285
  /**
290
286
  * Copy the id into a new byte array.
291
287
  */
292
288
  copyBytes(): Uint8Array;
289
+ /**
290
+ * Instantiate a client id from a byte array.
291
+ */
292
+ constructor(bytes: Uint8Array);
293
293
  }
294
294
  declare class ConversationConfiguration {
295
295
  free(): void;
@@ -320,214 +320,219 @@ declare class ConversationConfiguration {
320
320
  export class ConversationId {
321
321
  free(): void;
322
322
  [Symbol.dispose](): void;
323
- /**
324
- * Construct a new instance, transferring data from the client layer to Rust.
325
- */
326
- constructor(bytes: Uint8Array);
327
323
  /**
328
324
  * Get the raw bytes from this type, transferring data from Rust to the client layer.
329
325
  *
330
326
  * This does not consume the newtype, instead copying the internal data across the FFI boundary.
331
327
  */
332
328
  copyBytes(): Uint8Array;
329
+ /**
330
+ * Construct a new instance, transferring data from the client layer to Rust.
331
+ */
332
+ constructor(bytes: Uint8Array);
333
333
  }
334
334
  declare class CoreCryptoContext {
335
335
  private constructor();
336
336
  free(): void;
337
337
  [Symbol.dispose](): void;
338
338
  /**
339
- * See [core_crypto::transaction_context::TransactionContext::e2ei_new_enrollment]
339
+ * See [core_crypto::prelude::Session::random_bytes].
340
340
  */
341
- e2ei_new_enrollment(client_id: string, display_name: string, handle: string, team: string | null | undefined, expiry_sec: number, ciphersuite: Ciphersuite): Promise<FfiWireE2EIdentity>;
341
+ random_bytes(len: number): Promise<Uint8Array>;
342
342
  /**
343
- * See [core_crypto::transaction_context::TransactionContext::e2ei_new_activation_enrollment]
343
+ * See [core_crypto::transaction_context::TransactionContext::get_data]
344
344
  */
345
- e2ei_new_activation_enrollment(display_name: string, handle: string, team: string | null | undefined, expiry_sec: number, ciphersuite: Ciphersuite): Promise<FfiWireE2EIdentity>;
345
+ get_data(): Promise<Uint8Array | undefined>;
346
346
  /**
347
- * See [core_crypto::transaction_context::TransactionContext::e2ei_new_rotate_enrollment]
347
+ * See [core_crypto::transaction_context::TransactionContext::set_data]
348
348
  */
349
- e2ei_new_rotate_enrollment(display_name: string | null | undefined, handle: string | null | undefined, team: string | null | undefined, expiry_sec: number, ciphersuite: Ciphersuite): Promise<FfiWireE2EIdentity>;
349
+ set_data(data: Uint8Array): Promise<void>;
350
350
  /**
351
- * See [core_crypto::transaction_context::TransactionContext::e2ei_register_acme_ca]
351
+ * See [core_crypto::mls::conversation::Conversation::get_client_ids]
352
352
  */
353
- e2ei_register_acme_ca(trust_anchor_pem: string): Promise<void>;
353
+ get_client_ids(conversation_id: ConversationId): Promise<ClientId[]>;
354
354
  /**
355
- * See [core_crypto::transaction_context::TransactionContext::e2ei_register_intermediate_ca_pem]
355
+ * See [core_crypto::mls::conversation::ConversationGuard::decrypt_message]
356
356
  */
357
- e2ei_register_intermediate_ca(cert_pem: string): Promise<string[] | undefined>;
357
+ decrypt_message(conversation_id: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
358
358
  /**
359
- * See [core_crypto::transaction_context::TransactionContext::e2ei_register_crl]
359
+ * See [core_crypto::mls::conversation::ConversationGuard::encrypt_message]
360
360
  */
361
- e2ei_register_crl(crl_dp: string, crl_der: Uint8Array): Promise<CrlRegistration>;
361
+ encrypt_message(conversation_id: ConversationId, message: Uint8Array): Promise<Uint8Array>;
362
362
  /**
363
- * See [core_crypto::transaction_context::TransactionContext::e2ei_mls_init_only]
363
+ * See [core_crypto::transaction_context::TransactionContext::client_public_key]
364
364
  */
365
- e2ei_mls_init_only(enrollment: FfiWireE2EIdentity, certificate_chain: string, nb_key_package?: number | null): Promise<string[] | undefined>;
365
+ client_public_key(ciphersuite: Ciphersuite, credential_type: CredentialType): Promise<Uint8Array>;
366
366
  /**
367
- * See [core_crypto::mls::conversation::ConversationGuard::e2ei_rotate]
367
+ * See [core_crypto::mls::conversation::Conversation::export_secret_key]
368
368
  */
369
- e2ei_rotate(conversation_id: ConversationId): Promise<void>;
369
+ export_secret_key(conversation_id: ConversationId, key_length: number): Promise<SecretKey>;
370
370
  /**
371
- * See [core_crypto::transaction_context::TransactionContext::save_x509_credential]
371
+ * See [core_crypto::mls::conversation::ConversationGuard::wipe]
372
372
  */
373
- save_x509_credential(enrollment: FfiWireE2EIdentity, certificate_chain: string): Promise<string[] | undefined>;
373
+ wipe_conversation(conversation_id: ConversationId): Promise<void>;
374
374
  /**
375
- * See [core_crypto::transaction_context::TransactionContext::delete_stale_key_packages]
375
+ * See [core_crypto::transaction_context::TransactionContext::get_or_create_client_keypackages]
376
376
  */
377
- delete_stale_key_packages(ciphersuite: Ciphersuite): Promise<void>;
377
+ client_keypackages(ciphersuite: Ciphersuite, credential_type: CredentialType, amount_requested: number): Promise<KeyPackage[]>;
378
378
  /**
379
- * See [core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash]
380
- *
381
- * Note that this can only succeed if the enrollment is unique and there are no other hard refs to it.
379
+ * See [core_crypto::mls::conversation::Conversation::epoch]
382
380
  */
383
- e2ei_enrollment_stash(enrollment: FfiWireE2EIdentity): Promise<Uint8Array>;
381
+ conversation_epoch(conversation_id: ConversationId): Promise<bigint>;
384
382
  /**
385
- * See [core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash_pop]
383
+ * See [core_crypto::prelude::Session::conversation_exists]
386
384
  */
387
- e2ei_enrollment_stash_pop(handle: Uint8Array): Promise<FfiWireE2EIdentity>;
385
+ conversation_exists(conversation_id: ConversationId): Promise<boolean>;
388
386
  /**
389
- * See [core_crypto::mls::conversation::Conversation::e2ei_conversation_state]
387
+ * See [core_crypto::transaction_context::TransactionContext::new_conversation]
390
388
  */
391
- e2ei_conversation_state(conversation_id: ConversationId): Promise<E2eiConversationState>;
389
+ create_conversation(conversation_id: ConversationId, creator_credential_type: CredentialType, config: ConversationConfiguration): Promise<void>;
392
390
  /**
393
- * See [core_crypto::prelude::Session::e2ei_is_enabled]
391
+ * See [core_crypto::mls::conversation::Conversation::get_external_sender]
394
392
  */
395
- e2ei_is_enabled(ciphersuite: Ciphersuite): Promise<boolean>;
393
+ get_external_sender(conversation_id: ConversationId): Promise<ExternalSenderKey>;
396
394
  /**
397
- * See [core_crypto::mls::conversation::Conversation::get_device_identities]
395
+ * See [core_crypto::mls::conversation::ConversationGuard::enable_history_sharing]
398
396
  */
399
- get_device_identities(conversation_id: ConversationId, device_ids: ClientId[]): Promise<WireIdentity[]>;
397
+ enable_history_sharing(conversation_id: ConversationId): Promise<void>;
400
398
  /**
401
- * See [core_crypto::mls::conversation::Conversation::get_user_identities]
399
+ * See [core_crypto::mls::conversation::ConversationGuard::update_key_material]
402
400
  */
403
- get_user_identities(conversation_id: ConversationId, user_ids: string[]): Promise<Map<string, WireIdentity[]>>;
401
+ update_keying_material(conversation_id: ConversationId): Promise<void>;
404
402
  /**
405
- * See [core_crypto::prelude::Session::e2ei_is_pki_env_setup]
403
+ * See [core_crypto::mls::conversation::ConversationGuard::disable_history_sharing]
406
404
  */
407
- e2ei_is_pki_env_setup(): Promise<boolean>;
405
+ disable_history_sharing(conversation_id: ConversationId): Promise<void>;
408
406
  /**
409
- * See [core_crypto::transaction_context::TransactionContext::mls_init]
407
+ * See [core_crypto::transaction_context::TransactionContext::join_by_external_commit]
410
408
  */
411
- mls_init(client_id: ClientId, ciphersuites: any[], nb_key_package?: number | null): Promise<void>;
409
+ join_by_external_commit(group_info: GroupInfo, custom_configuration: CustomConfiguration, credential_type: CredentialType): Promise<WelcomeBundle>;
412
410
  /**
413
- * See [core_crypto::transaction_context::TransactionContext::client_public_key]
411
+ * See [core_crypto::transaction_context::TransactionContext::process_raw_welcome_message]
414
412
  */
415
- client_public_key(ciphersuite: Ciphersuite, credential_type: CredentialType): Promise<Uint8Array>;
413
+ process_welcome_message(welcome_message: Welcome, custom_configuration: CustomConfiguration): Promise<WelcomeBundle>;
416
414
  /**
417
- * See [core_crypto::mls::conversation::Conversation::epoch]
415
+ * See [core_crypto::mls::conversation::ConversationGuard::commit_pending_proposals]
418
416
  */
419
- conversation_epoch(conversation_id: ConversationId): Promise<bigint>;
417
+ commit_pending_proposals(conversation_id: ConversationId): Promise<void>;
420
418
  /**
421
419
  * See [core_crypto::mls::conversation::Conversation::ciphersuite]
422
420
  */
423
421
  conversation_ciphersuite(conversation_id: ConversationId): Promise<Ciphersuite>;
424
422
  /**
425
- * See [core_crypto::prelude::Session::conversation_exists]
423
+ * See [core_crypto::mls::conversation::ConversationGuard::add_members]
426
424
  */
427
- conversation_exists(conversation_id: ConversationId): Promise<boolean>;
425
+ add_clients_to_conversation(conversation_id: ConversationId, key_packages: KeyPackage[]): Promise<string[] | undefined>;
428
426
  /**
429
- * See [core_crypto::mls::conversation::Conversation::get_client_ids]
427
+ * See [core_crypto::mls::conversation::ConversationGuard::mark_as_child_of]
430
428
  */
431
- get_client_ids(conversation_id: ConversationId): Promise<ClientId[]>;
429
+ mark_conversation_as_child_of(child_id: ConversationId, parent_id: ConversationId): Promise<void>;
432
430
  /**
433
- * See [core_crypto::mls::conversation::Conversation::export_secret_key]
431
+ * See [core_crypto::transaction_context::TransactionContext::client_valid_key_packages_count]
434
432
  */
435
- export_secret_key(conversation_id: ConversationId, key_length: number): Promise<SecretKey>;
433
+ client_valid_keypackages_count(ciphersuite: Ciphersuite, credential_type: CredentialType): Promise<bigint>;
436
434
  /**
437
- * See [core_crypto::mls::conversation::Conversation::get_external_sender]
435
+ * See [core_crypto::mls::conversation::ConversationGuard::remove_members]
438
436
  */
439
- get_external_sender(conversation_id: ConversationId): Promise<ExternalSenderKey>;
437
+ remove_clients_from_conversation(conversation_id: ConversationId, clients: ClientId[]): Promise<void>;
440
438
  /**
441
- * See [core_crypto::transaction_context::TransactionContext::get_or_create_client_keypackages]
439
+ * See [core_crypto::transaction_context::TransactionContext::mls_init]
442
440
  */
443
- client_keypackages(ciphersuite: Ciphersuite, credential_type: CredentialType, amount_requested: number): Promise<KeyPackage[]>;
441
+ mls_init(client_id: ClientId, ciphersuites: any[], nb_key_package?: number | null): Promise<void>;
444
442
  /**
445
- * See [core_crypto::transaction_context::TransactionContext::client_valid_key_packages_count]
443
+ * See [core_crypto::mls::conversation::ConversationGuard::e2ei_rotate]
446
444
  */
447
- client_valid_keypackages_count(ciphersuite: Ciphersuite, credential_type: CredentialType): Promise<bigint>;
445
+ e2ei_rotate(conversation_id: ConversationId): Promise<void>;
448
446
  /**
449
- * See [core_crypto::transaction_context::TransactionContext::new_conversation]
447
+ * See [core_crypto::prelude::Session::e2ei_is_enabled]
450
448
  */
451
- create_conversation(conversation_id: ConversationId, creator_credential_type: CredentialType, config: ConversationConfiguration): Promise<void>;
449
+ e2ei_is_enabled(ciphersuite: Ciphersuite): Promise<boolean>;
452
450
  /**
453
- * See [core_crypto::transaction_context::TransactionContext::process_raw_welcome_message]
451
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_register_crl]
454
452
  */
455
- process_welcome_message(welcome_message: Welcome, custom_configuration: CustomConfiguration): Promise<WelcomeBundle>;
453
+ e2ei_register_crl(crl_dp: string, crl_der: Uint8Array): Promise<CrlRegistration>;
456
454
  /**
457
- * See [core_crypto::mls::conversation::ConversationGuard::add_members]
455
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_mls_init_only]
458
456
  */
459
- add_clients_to_conversation(conversation_id: ConversationId, key_packages: KeyPackage[]): Promise<string[] | undefined>;
457
+ e2ei_mls_init_only(enrollment: FfiWireE2EIdentity, certificate_chain: string, nb_key_package?: number | null): Promise<string[] | undefined>;
460
458
  /**
461
- * See [core_crypto::mls::conversation::ConversationGuard::remove_members]
459
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_new_enrollment]
462
460
  */
463
- remove_clients_from_conversation(conversation_id: ConversationId, clients: ClientId[]): Promise<void>;
461
+ e2ei_new_enrollment(client_id: string, display_name: string, handle: string, team: string | null | undefined, expiry_sec: number, ciphersuite: Ciphersuite): Promise<FfiWireE2EIdentity>;
464
462
  /**
465
- * See [core_crypto::mls::conversation::ConversationGuard::mark_as_child_of]
463
+ * See [core_crypto::mls::conversation::Conversation::get_user_identities]
466
464
  */
467
- mark_conversation_as_child_of(child_id: ConversationId, parent_id: ConversationId): Promise<void>;
465
+ get_user_identities(conversation_id: ConversationId, user_ids: string[]): Promise<Map<string, WireIdentity[]>>;
468
466
  /**
469
- * See [core_crypto::mls::conversation::ConversationGuard::update_key_material]
467
+ * See [core_crypto::transaction_context::TransactionContext::save_x509_credential]
470
468
  */
471
- update_keying_material(conversation_id: ConversationId): Promise<void>;
469
+ save_x509_credential(enrollment: FfiWireE2EIdentity, certificate_chain: string): Promise<string[] | undefined>;
472
470
  /**
473
- * See [core_crypto::mls::conversation::ConversationGuard::commit_pending_proposals]
471
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash]
472
+ *
473
+ * Note that this can only succeed if the enrollment is unique and there are no other hard refs to it.
474
474
  */
475
- commit_pending_proposals(conversation_id: ConversationId): Promise<void>;
475
+ e2ei_enrollment_stash(enrollment: FfiWireE2EIdentity): Promise<Uint8Array>;
476
476
  /**
477
- * See [core_crypto::mls::conversation::ConversationGuard::wipe]
477
+ * See [core_crypto::prelude::Session::e2ei_is_pki_env_setup]
478
478
  */
479
- wipe_conversation(conversation_id: ConversationId): Promise<void>;
479
+ e2ei_is_pki_env_setup(): Promise<boolean>;
480
480
  /**
481
- * See [core_crypto::mls::conversation::ConversationGuard::decrypt_message]
481
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_register_acme_ca]
482
482
  */
483
- decrypt_message(conversation_id: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
483
+ e2ei_register_acme_ca(trust_anchor_pem: string): Promise<void>;
484
484
  /**
485
- * See [core_crypto::mls::conversation::ConversationGuard::encrypt_message]
485
+ * See [core_crypto::mls::conversation::Conversation::get_device_identities]
486
486
  */
487
- encrypt_message(conversation_id: ConversationId, message: Uint8Array): Promise<Uint8Array>;
487
+ get_device_identities(conversation_id: ConversationId, device_ids: ClientId[]): Promise<WireIdentity[]>;
488
488
  /**
489
- * See [core_crypto::transaction_context::TransactionContext::join_by_external_commit]
489
+ * See [core_crypto::mls::conversation::Conversation::e2ei_conversation_state]
490
490
  */
491
- join_by_external_commit(group_info: GroupInfo, custom_configuration: CustomConfiguration, credential_type: CredentialType): Promise<WelcomeBundle>;
491
+ e2ei_conversation_state(conversation_id: ConversationId): Promise<E2eiConversationState>;
492
492
  /**
493
- * See [core_crypto::mls::conversation::ConversationGuard::enable_history_sharing]
493
+ * See [core_crypto::transaction_context::TransactionContext::delete_stale_key_packages]
494
494
  */
495
- enable_history_sharing(conversation_id: ConversationId): Promise<void>;
495
+ delete_stale_key_packages(ciphersuite: Ciphersuite): Promise<void>;
496
496
  /**
497
- * See [core_crypto::mls::conversation::ConversationGuard::disable_history_sharing]
497
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash_pop]
498
498
  */
499
- disable_history_sharing(conversation_id: ConversationId): Promise<void>;
499
+ e2ei_enrollment_stash_pop(handle: Uint8Array): Promise<FfiWireE2EIdentity>;
500
500
  /**
501
- * See [core_crypto::proteus::ProteusCentral::try_new]
501
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_new_rotate_enrollment]
502
502
  */
503
- proteus_init(): Promise<void>;
503
+ e2ei_new_rotate_enrollment(display_name: string | null | undefined, handle: string | null | undefined, team: string | null | undefined, expiry_sec: number, ciphersuite: Ciphersuite): Promise<FfiWireE2EIdentity>;
504
504
  /**
505
- * See [core_crypto::transaction_context::TransactionContext::proteus_session_from_prekey]
505
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_register_intermediate_ca_pem]
506
506
  */
507
- proteus_session_from_prekey(session_id: string, prekey: Uint8Array): Promise<void>;
507
+ e2ei_register_intermediate_ca(cert_pem: string): Promise<string[] | undefined>;
508
508
  /**
509
- * See [core_crypto::transaction_context::TransactionContext::proteus_session_from_message]
509
+ * See [core_crypto::transaction_context::TransactionContext::e2ei_new_activation_enrollment]
510
510
  */
511
- proteus_session_from_message(session_id: string, envelope: Uint8Array): Promise<Uint8Array>;
511
+ e2ei_new_activation_enrollment(display_name: string, handle: string, team: string | null | undefined, expiry_sec: number, ciphersuite: Ciphersuite): Promise<FfiWireE2EIdentity>;
512
512
  /**
513
- * See [core_crypto::transaction_context::TransactionContext::proteus_session_save]
514
- *
515
- * **Note**: This isn't usually needed as persisting sessions happens automatically when
516
- * decrypting/encrypting messages and initializing Sessions
513
+ * See [core_crypto::proteus::ProteusCentral::try_new]
517
514
  */
518
- proteus_session_save(session_id: string): Promise<void>;
515
+ proteus_init(): Promise<void>;
519
516
  /**
520
- * See [core_crypto::transaction_context::TransactionContext::proteus_session_delete]
517
+ * See [core_crypto::transaction_context::TransactionContext::proteus_decrypt]
521
518
  */
522
- proteus_session_delete(session_id: string): Promise<void>;
519
+ proteus_decrypt(session_id: string, ciphertext: Uint8Array): Promise<Uint8Array>;
523
520
  /**
524
- * See [core_crypto::transaction_context::TransactionContext::proteus_session_exists]
521
+ * See [core_crypto::transaction_context::TransactionContext::proteus_encrypt]
525
522
  */
526
- proteus_session_exists(session_id: string): Promise<boolean>;
523
+ proteus_encrypt(session_id: string, plaintext: Uint8Array): Promise<Uint8Array>;
527
524
  /**
528
- * See [core_crypto::transaction_context::TransactionContext::proteus_decrypt]
525
+ * Creates a new Proteus prekey with the given id and returns the CBOR-serialized version of the prekey bundle
526
+ *
527
+ * Warning: The Proteus client **MUST** be initialized with `proteus_init` first or an error will be returned
528
+ *
529
+ * See [core_crypto::transaction_context::TransactionContext::proteus_new_prekey]
529
530
  */
530
- proteus_decrypt(session_id: string, ciphertext: Uint8Array): Promise<Uint8Array>;
531
+ proteus_new_prekey(prekey_id: number): Promise<Uint8Array>;
532
+ /**
533
+ * See [core_crypto::transaction_context::TransactionContext::proteus_fingerprint]
534
+ */
535
+ proteus_fingerprint(): Promise<string>;
531
536
  /**
532
537
  * Decrypt a message whether or not the proteus session already exists, and saves the session.
533
538
  *
@@ -538,21 +543,24 @@ declare class CoreCryptoContext {
538
543
  */
539
544
  proteus_decrypt_safe(session_id: string, ciphertext: Uint8Array): Promise<Uint8Array>;
540
545
  /**
541
- * See [core_crypto::transaction_context::TransactionContext::proteus_encrypt]
546
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_save]
547
+ *
548
+ * **Note**: This isn't usually needed as persisting sessions happens automatically when
549
+ * decrypting/encrypting messages and initializing Sessions
542
550
  */
543
- proteus_encrypt(session_id: string, plaintext: Uint8Array): Promise<Uint8Array>;
551
+ proteus_session_save(session_id: string): Promise<void>;
544
552
  /**
545
- * See [core_crypto::transaction_context::TransactionContext::proteus_encrypt_batched]
553
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_delete]
546
554
  */
547
- proteus_encrypt_batched(sessions: string[], plaintext: Uint8Array): Promise<Map<string, Uint8Array>>;
555
+ proteus_session_delete(session_id: string): Promise<void>;
548
556
  /**
549
- * Creates a new Proteus prekey with the given id and returns the CBOR-serialized version of the prekey bundle
550
- *
551
- * Warning: The Proteus client **MUST** be initialized with `proteus_init` first or an error will be returned
552
- *
553
- * See [core_crypto::transaction_context::TransactionContext::proteus_new_prekey]
557
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_exists]
554
558
  */
555
- proteus_new_prekey(prekey_id: number): Promise<Uint8Array>;
559
+ proteus_session_exists(session_id: string): Promise<boolean>;
560
+ /**
561
+ * See [core_crypto::transaction_context::TransactionContext::proteus_encrypt_batched]
562
+ */
563
+ proteus_encrypt_batched(sessions: string[], plaintext: Uint8Array): Promise<Map<string, Uint8Array>>;
556
564
  /**
557
565
  * Creates a new Proteus prekey with an automatically incremented ID and returns the CBOR-serialized version of the prekey bundle
558
566
  *
@@ -562,13 +570,9 @@ declare class CoreCryptoContext {
562
570
  */
563
571
  proteus_new_prekey_auto(): Promise<ProteusAutoPrekeyBundle>;
564
572
  /**
565
- * See [core_crypto::transaction_context::TransactionContext::proteus_last_resort_prekey]
566
- */
567
- proteus_last_resort_prekey(): Promise<Uint8Array>;
568
- /**
569
- * See [core_crypto::transaction_context::TransactionContext::proteus_fingerprint]
573
+ * See [core_crypto::transaction_context::TransactionContext::proteus_reload_sessions]
570
574
  */
571
- proteus_fingerprint(): Promise<string>;
575
+ proteus_reload_sessions(): Promise<void>;
572
576
  /**
573
577
  * See [core_crypto::transaction_context::TransactionContext::proteus_fingerprint_local]
574
578
  */
@@ -578,29 +582,25 @@ declare class CoreCryptoContext {
578
582
  */
579
583
  proteus_fingerprint_remote(session_id: string): Promise<string>;
580
584
  /**
581
- * See [core_crypto::transaction_context::TransactionContext::proteus_reload_sessions]
582
- */
583
- proteus_reload_sessions(): Promise<void>;
584
- /**
585
- * See [core_crypto::proteus::ProteusCentral::last_resort_prekey_id]
585
+ * See [core_crypto::transaction_context::TransactionContext::proteus_last_resort_prekey]
586
586
  */
587
- static proteus_last_resort_prekey_id(): number;
587
+ proteus_last_resort_prekey(): Promise<Uint8Array>;
588
588
  /**
589
- * See [core_crypto::proteus::ProteusCentral::fingerprint_prekeybundle]
589
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_from_prekey]
590
590
  */
591
- static proteus_fingerprint_prekeybundle(prekey: Uint8Array): string;
591
+ proteus_session_from_prekey(session_id: string, prekey: Uint8Array): Promise<void>;
592
592
  /**
593
- * See [core_crypto::transaction_context::TransactionContext::set_data]
593
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_from_message]
594
594
  */
595
- set_data(data: Uint8Array): Promise<void>;
595
+ proteus_session_from_message(session_id: string, envelope: Uint8Array): Promise<Uint8Array>;
596
596
  /**
597
- * See [core_crypto::transaction_context::TransactionContext::get_data]
597
+ * See [core_crypto::proteus::ProteusCentral::last_resort_prekey_id]
598
598
  */
599
- get_data(): Promise<Uint8Array | undefined>;
599
+ static proteus_last_resort_prekey_id(): number;
600
600
  /**
601
- * See [core_crypto::prelude::Session::random_bytes].
601
+ * See [core_crypto::proteus::ProteusCentral::fingerprint_prekeybundle]
602
602
  */
603
- random_bytes(len: number): Promise<Uint8Array>;
603
+ static proteus_fingerprint_prekeybundle(prekey: Uint8Array): string;
604
604
  }
605
605
  declare class CrlRegistration {
606
606
  free(): void;
@@ -725,85 +725,85 @@ declare class DecryptedMessage {
725
725
  export class ExternalSenderKey {
726
726
  free(): void;
727
727
  [Symbol.dispose](): void;
728
- /**
729
- * Construct a new instance, transferring data from the client layer to Rust.
730
- */
731
- constructor(bytes: Uint8Array);
732
728
  /**
733
729
  * Get the raw bytes from this type, transferring data from Rust to the client layer.
734
730
  *
735
731
  * This does not consume the newtype, instead copying the internal data across the FFI boundary.
736
732
  */
737
733
  copyBytes(): Uint8Array;
734
+ /**
735
+ * Construct a new instance, transferring data from the client layer to Rust.
736
+ */
737
+ constructor(bytes: Uint8Array);
738
738
  }
739
739
  declare class FfiWireE2EIdentity {
740
740
  private constructor();
741
741
  free(): void;
742
742
  [Symbol.dispose](): void;
743
743
  /**
744
- * See [core_crypto::e2e_identity::E2eiEnrollment::directory_response]
744
+ * See [core_crypto::prelude::E2eiEnrollment::finalize_request]
745
745
  */
746
- directory_response(directory: Uint8Array): Promise<AcmeDirectory>;
746
+ finalize_request(previous_nonce: string): Promise<Uint8Array>;
747
747
  /**
748
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_account_request]
748
+ * See [core_crypto::e2e_identity::E2eiEnrollment::create_dpop_token]
749
749
  */
750
- new_account_request(previous_nonce: string): Promise<Uint8Array>;
750
+ create_dpop_token(expiry_secs: number, backend_nonce: string): Promise<string>;
751
751
  /**
752
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_account_response]
752
+ * See [core_crypto::prelude::E2eiEnrollment::finalize_response]
753
753
  */
754
- new_account_response(account: Uint8Array): Promise<void>;
754
+ finalize_response(finalize: Uint8Array): Promise<string>;
755
755
  /**
756
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_order_request]
756
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_authz_request]
757
757
  */
758
- new_order_request(previous_nonce: string): Promise<Uint8Array>;
758
+ new_authz_request(url: string, previous_nonce: string): Promise<Uint8Array>;
759
759
  /**
760
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_order_response]
760
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_order_request]
761
761
  */
762
- new_order_response(order: Uint8Array): Promise<NewAcmeOrder>;
762
+ new_order_request(previous_nonce: string): Promise<Uint8Array>;
763
763
  /**
764
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_authz_request]
764
+ * See [core_crypto::e2e_identity::E2eiEnrollment::directory_response]
765
765
  */
766
- new_authz_request(url: string, previous_nonce: string): Promise<Uint8Array>;
766
+ directory_response(directory: Uint8Array): Promise<AcmeDirectory>;
767
767
  /**
768
768
  * See [core_crypto::e2e_identity::E2eiEnrollment::new_authz_response]
769
769
  */
770
770
  new_authz_response(authz: Uint8Array): Promise<NewAcmeAuthz>;
771
771
  /**
772
- * See [core_crypto::e2e_identity::E2eiEnrollment::create_dpop_token]
773
- */
774
- create_dpop_token(expiry_secs: number, backend_nonce: string): Promise<string>;
775
- /**
776
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_dpop_challenge_request]
772
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_order_response]
777
773
  */
778
- new_dpop_challenge_request(access_token: string, previous_nonce: string): Promise<Uint8Array>;
774
+ new_order_response(order: Uint8Array): Promise<NewAcmeOrder>;
779
775
  /**
780
- * See [core_crypto::e2e_identity::E2eiEnrollment::new_dpop_challenge_response]
776
+ * See [core_crypto::prelude::E2eiEnrollment::certificate_request]
781
777
  */
782
- new_dpop_challenge_response(challenge: Uint8Array): Promise<void>;
778
+ certificate_request(previous_nonce: string): Promise<Uint8Array>;
783
779
  /**
784
780
  * See [core_crypto::e2e_identity::E2eiEnrollment::check_order_request]
785
781
  */
786
782
  check_order_request(order_url: string, previous_nonce: string): Promise<Uint8Array>;
787
783
  /**
788
- * See [core_crypto::e2e_identity::E2eiEnrollment::check_order_response]
784
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_account_request]
789
785
  */
790
- check_order_response(order: Uint8Array): Promise<string>;
786
+ new_account_request(previous_nonce: string): Promise<Uint8Array>;
791
787
  /**
792
- * See [core_crypto::prelude::E2eiEnrollment::finalize_request]
788
+ * See [core_crypto::e2e_identity::E2eiEnrollment::check_order_response]
793
789
  */
794
- finalize_request(previous_nonce: string): Promise<Uint8Array>;
790
+ check_order_response(order: Uint8Array): Promise<string>;
795
791
  /**
796
- * See [core_crypto::prelude::E2eiEnrollment::finalize_response]
792
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_account_response]
797
793
  */
798
- finalize_response(finalize: Uint8Array): Promise<string>;
794
+ new_account_response(account: Uint8Array): Promise<void>;
799
795
  /**
800
- * See [core_crypto::prelude::E2eiEnrollment::certificate_request]
796
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_dpop_challenge_request]
801
797
  */
802
- certificate_request(previous_nonce: string): Promise<Uint8Array>;
798
+ new_dpop_challenge_request(access_token: string, previous_nonce: string): Promise<Uint8Array>;
803
799
  /**
804
800
  * See [core_crypto::e2e_identity::E2eiEnrollment::new_oidc_challenge_request]
805
801
  */
806
802
  new_oidc_challenge_request(id_token: string, previous_nonce: string): Promise<Uint8Array>;
803
+ /**
804
+ * See [core_crypto::e2e_identity::E2eiEnrollment::new_dpop_challenge_response]
805
+ */
806
+ new_dpop_challenge_response(challenge: Uint8Array): Promise<void>;
807
807
  /**
808
808
  * See [core_crypto::e2e_identity::E2eiEnrollment::new_oidc_challenge_response]
809
809
  */
@@ -818,30 +818,30 @@ declare class FfiWireE2EIdentity {
818
818
  export class GroupInfo {
819
819
  free(): void;
820
820
  [Symbol.dispose](): void;
821
- /**
822
- * Construct a new instance, transferring data from the client layer to Rust.
823
- */
824
- constructor(bytes: Uint8Array);
825
821
  /**
826
822
  * Get the raw bytes from this type, transferring data from Rust to the client layer.
827
823
  *
828
824
  * This does not consume the newtype, instead copying the internal data across the FFI boundary.
829
825
  */
830
826
  copyBytes(): Uint8Array;
831
- }
832
- declare class KeyPackage {
833
- free(): void;
834
- [Symbol.dispose](): void;
835
827
  /**
836
828
  * Construct a new instance, transferring data from the client layer to Rust.
837
829
  */
838
830
  constructor(bytes: Uint8Array);
831
+ }
832
+ declare class KeyPackage {
833
+ free(): void;
834
+ [Symbol.dispose](): void;
839
835
  /**
840
836
  * Get the raw bytes from this type, transferring data from Rust to the client layer.
841
837
  *
842
838
  * This does not consume the newtype, instead copying the internal data across the FFI boundary.
843
839
  */
844
840
  copyBytes(): Uint8Array;
841
+ /**
842
+ * Construct a new instance, transferring data from the client layer to Rust.
843
+ */
844
+ constructor(bytes: Uint8Array);
845
845
  }
846
846
  /**
847
847
  * An entity / data which has been packaged by the application to be encrypted
@@ -922,16 +922,16 @@ declare class ProteusAutoPrekeyBundle {
922
922
  export class SecretKey {
923
923
  free(): void;
924
924
  [Symbol.dispose](): void;
925
- /**
926
- * Construct a new instance, transferring data from the client layer to Rust.
927
- */
928
- constructor(bytes: Uint8Array);
929
925
  /**
930
926
  * Get the raw bytes from this type, transferring data from Rust to the client layer.
931
927
  *
932
928
  * This does not consume the newtype, instead copying the internal data across the FFI boundary.
933
929
  */
934
930
  copyBytes(): Uint8Array;
931
+ /**
932
+ * Construct a new instance, transferring data from the client layer to Rust.
933
+ */
934
+ constructor(bytes: Uint8Array);
935
935
  }
936
936
  /**
937
937
  * r" A TLS-serialized Welcome message.
@@ -942,16 +942,16 @@ export class SecretKey {
942
942
  export class Welcome {
943
943
  free(): void;
944
944
  [Symbol.dispose](): void;
945
- /**
946
- * Construct a new instance, transferring data from the client layer to Rust.
947
- */
948
- constructor(bytes: Uint8Array);
949
945
  /**
950
946
  * Get the raw bytes from this type, transferring data from Rust to the client layer.
951
947
  *
952
948
  * This does not consume the newtype, instead copying the internal data across the FFI boundary.
953
949
  */
954
950
  copyBytes(): Uint8Array;
951
+ /**
952
+ * Construct a new instance, transferring data from the client layer to Rust.
953
+ */
954
+ constructor(bytes: Uint8Array);
955
955
  }
956
956
  /**
957
957
  * see [core_crypto::prelude::WelcomeBundle]