@wireapp/core-crypto 1.0.0-rc.5 → 1.0.0-rc.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,74 @@
1
+ /**
2
+ * For creating a challenge.
3
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
4
+ */
5
+ export class AcmeChallenge {
6
+ free(): void;
7
+ /**
8
+ * Contains raw JSON data of this challenge. This is parsed by the underlying Rust library hence should not be accessed
9
+ */
10
+ readonly delegate: Uint8Array;
11
+ /**
12
+ * Non-standard, Wire specific claim. Indicates the consumer from where it should get the challenge proof.
13
+ * Either from wire-server "/access-token" endpoint in case of a DPoP challenge, or from an OAuth token endpoint for an OIDC challenge
14
+ */
15
+ readonly target: string;
16
+ /**
17
+ * URL of this challenge
18
+ */
19
+ readonly url: string;
20
+ }
21
+ /**
22
+ * Dump of the PKI environemnt as PEM
23
+ */
24
+ export class E2eiDumpedPkiEnv {
25
+ free(): void;
26
+ /**
27
+ * CRLs registered in the PKI env
28
+ */
29
+ readonly crls: (string)[];
30
+ /**
31
+ * Intermediate CAs that are loaded
32
+ */
33
+ readonly intermediates: (string)[];
34
+ /**
35
+ * Root CA in use (i.e. Trust Anchor)
36
+ */
37
+ readonly root_ca: string;
38
+ }
39
+ /**
40
+ * Result of an authorization creation.
41
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
42
+ */
43
+ export class NewAcmeAuthz {
44
+ free(): void;
45
+ /**
46
+ * Associated ACME Challenge
47
+ */
48
+ readonly challenge: AcmeChallenge;
49
+ /**
50
+ * DNS entry associated with those challenge
51
+ */
52
+ readonly identifier: string;
53
+ /**
54
+ * ACME challenge + ACME key thumbprint
55
+ */
56
+ readonly keyauth: string | undefined;
57
+ }
58
+ /**
59
+ * Result of an order creation.
60
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
61
+ */
62
+ export class NewAcmeOrder {
63
+ free(): void;
64
+ /**
65
+ */
66
+ readonly authorizations: (Uint8Array)[];
67
+ /**
68
+ * Contains raw JSON data of this order. This is parsed by the underlying Rust library hence should not be accessed
69
+ */
70
+ readonly delegate: Uint8Array;
71
+ }
1
72
  /**
2
73
  * Error wrapper that takes care of extracting rich error details across the FFI (through JSON parsing)
3
74
  *
@@ -79,24 +150,6 @@ export interface ConversationConfiguration {
79
150
  * Implementation specific configuration
80
151
  */
81
152
  custom?: CustomConfiguration;
82
- /**
83
- * Trust anchors to be added in the group's context extensions
84
- */
85
- perDomainTrustAnchors?: PerDomainTrustAnchor[];
86
- }
87
- /**
88
- * A wrapper containing the configuration for trust anchors to be added in the group's context
89
- * extensions
90
- */
91
- export interface PerDomainTrustAnchor {
92
- /**
93
- * Domain name of the owning backend this anchor refers to. One of the certificate in the chain has to have this domain in its SANs
94
- */
95
- domain_name: string;
96
- /**
97
- * PEM encoded (partial) certificate chain. This contains the certificate chain for the CA certificate issuing the E2E Identity certificates
98
- */
99
- intermediate_certificate_chain: string;
100
153
  }
101
154
  /**
102
155
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -179,6 +232,10 @@ export interface MemberAddedMessages {
179
232
  * @readonly
180
233
  */
181
234
  groupInfo: GroupInfoBundle;
235
+ /**
236
+ * New CRL distribution points that appeared by the introduction of a new credential
237
+ */
238
+ crlNewDistributionPoints?: string[];
182
239
  }
183
240
  /**
184
241
  * Data shape for a MLS generic commit + optional bundle (aka stapled commit & welcome)
@@ -262,7 +319,7 @@ export interface RotateBundle {
262
319
  *
263
320
  * @readonly
264
321
  */
265
- commits: CommitBundle[];
322
+ commits: Map<string, CommitBundle>;
266
323
  /**
267
324
  * Fresh KeyPackages with the new Credential
268
325
  *
@@ -275,6 +332,10 @@ export interface RotateBundle {
275
332
  * @readonly
276
333
  */
277
334
  keyPackageRefsToRemove: Uint8Array[];
335
+ /**
336
+ * New CRL distribution points that appeared by the introduction of a new credential
337
+ */
338
+ crlNewDistributionPoints?: string[];
278
339
  }
279
340
  /**
280
341
  * Params for CoreCrypto deferred initialization
@@ -303,6 +364,10 @@ export interface CoreCryptoDeferredParams {
303
364
  * .wasm file path, this will be useful in case your bundling system likes to relocate files (i.e. what webpack does)
304
365
  */
305
366
  wasmFilePath?: string;
367
+ /**
368
+ * Number of initial KeyPackage to create when initializing the client
369
+ */
370
+ nbKeyPackage?: number;
306
371
  }
307
372
  /**
308
373
  * Params for CoreCrypto initialization
@@ -315,19 +380,6 @@ export interface CoreCryptoParams extends CoreCryptoDeferredParams {
315
380
  */
316
381
  clientId: ClientId;
317
382
  }
318
- /**
319
- * Data shape for adding clients to a conversation
320
- */
321
- export interface Invitee {
322
- /**
323
- * Client ID as a byte array
324
- */
325
- id: ClientId;
326
- /**
327
- * MLS KeyPackage belonging to the aforementioned client
328
- */
329
- kp: Uint8Array;
330
- }
331
383
  export interface ConversationInitBundle {
332
384
  /**
333
385
  * Conversation ID of the conversation created
@@ -348,6 +400,27 @@ export interface ConversationInitBundle {
348
400
  * @readonly
349
401
  */
350
402
  groupInfo: GroupInfoBundle;
403
+ /**
404
+ * New CRL distribution points that appeared by the introduction of a new credential
405
+ */
406
+ crlNewDistributionPoints?: string[];
407
+ }
408
+ /**
409
+ * Supporting struct for CRL registration result
410
+ */
411
+ export interface CRLRegistration {
412
+ /**
413
+ * Whether this CRL modifies the old CRL (i.e. has a different revocated cert list)
414
+ *
415
+ * @readonly
416
+ */
417
+ dirty: boolean;
418
+ /**
419
+ * Optional expiration timestamp
420
+ *
421
+ * @readonly
422
+ */
423
+ expiration?: number;
351
424
  }
352
425
  /**
353
426
  * This is a wrapper for all the possible outcomes you can get after decrypting a message
@@ -386,17 +459,65 @@ export interface DecryptedMessage {
386
459
  * Present for all messages
387
460
  */
388
461
  identity?: WireIdentity;
462
+ /**
463
+ * Only set when the decrypted message is a commit.
464
+ * Contains buffered messages for next epoch which were received before the commit creating the epoch
465
+ * because the DS did not fan them out in order.
466
+ */
467
+ bufferedMessages?: BufferedDecryptedMessage[];
468
+ /**
469
+ * New CRL distribution points that appeared by the introduction of a new credential
470
+ */
471
+ crlNewDistributionPoints?: string[];
472
+ }
473
+ /**
474
+ * Almost same as {@link DecryptedMessage} but avoids recursion
475
+ */
476
+ export interface BufferedDecryptedMessage {
477
+ /**
478
+ * see {@link DecryptedMessage.message}
479
+ */
480
+ message?: Uint8Array;
481
+ /**
482
+ * see {@link DecryptedMessage.proposals}
483
+ */
484
+ proposals: ProposalBundle[];
485
+ /**
486
+ * see {@link DecryptedMessage.isActive}
487
+ */
488
+ isActive: boolean;
489
+ /**
490
+ * see {@link DecryptedMessage.commitDelay}
491
+ */
492
+ commitDelay?: number;
493
+ /**
494
+ * see {@link DecryptedMessage.senderClientId}
495
+ */
496
+ senderClientId?: ClientId;
497
+ /**
498
+ * see {@link DecryptedMessage.hasEpochChanged}
499
+ */
500
+ hasEpochChanged: boolean;
501
+ /**
502
+ * see {@link DecryptedMessage.identity}
503
+ */
504
+ identity?: WireIdentity;
505
+ /**
506
+ * see {@link DecryptedMessage.crlNewDistributionPoints}
507
+ */
508
+ crlNewDistributionPoints?: string[];
389
509
  }
390
510
  /**
391
- * Represents the identity claims identifying a client. Those claims are verifiable by any member in the group
511
+ * Represents the identity claims identifying a client
512
+ * Those claims are verifiable by any member in the group
392
513
  */
393
514
  export interface WireIdentity {
394
515
  /**
395
- * Represents the identity claims identifying a client. Those claims are verifiable by any member in the group
516
+ * Unique client identifier
396
517
  */
397
518
  clientId: string;
398
519
  /**
399
- * user handle e.g. `john_wire`
520
+ * User handle e.g. `john_wire`
400
521
  */
401
522
  handle: string;
402
523
  /**
@@ -407,6 +528,66 @@ export interface WireIdentity {
407
528
  * DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
408
529
  */
409
530
  domain: string;
531
+ /**
532
+ * X509 certificate identifying this client in the MLS group ; PEM encoded
533
+ */
534
+ certificate: string;
535
+ /**
536
+ * Status of the Credential at the moment T when this object is created
537
+ */
538
+ status: DeviceStatus;
539
+ /**
540
+ * MLS thumbprint
541
+ */
542
+ thumbprint: string;
543
+ /**
544
+ * X509 certificate serial number
545
+ */
546
+ serialNumber: string;
547
+ /**
548
+ * X509 certificate not before as Unix timestamp
549
+ */
550
+ notBefore: bigint;
551
+ /**
552
+ * X509 certificate not after as Unix timestamp
553
+ */
554
+ notAfter: bigint;
555
+ }
556
+ export interface AcmeDirectory {
557
+ /**
558
+ * URL for fetching a new nonce. Use this only for creating a new account.
559
+ */
560
+ newNonce: string;
561
+ /**
562
+ * URL for creating a new account.
563
+ */
564
+ newAccount: string;
565
+ /**
566
+ * URL for creating a new order.
567
+ */
568
+ newOrder: string;
569
+ /**
570
+ * Revocation URL
571
+ */
572
+ revokeCert: string;
573
+ }
574
+ /**
575
+ * Indicates the standalone status of a device Credential in a MLS group at a moment T.
576
+ * This does not represent the states where a device is not using MLS or is not using end-to-end identity
577
+ */
578
+ export declare enum DeviceStatus {
579
+ /**
580
+ * All is fine
581
+ */
582
+ Valid = 1,
583
+ /**
584
+ * The Credential's certificate is expired
585
+ */
586
+ Expired = 2,
587
+ /**
588
+ * The Credential's certificate is revoked
589
+ */
590
+ Revoked = 3
410
591
  }
411
592
  /**
412
593
  * Returned by all methods creating proposals. Contains a proposal message and an identifier to roll back the proposal
@@ -424,6 +605,26 @@ export interface ProposalBundle {
424
605
  * @readonly
425
606
  */
426
607
  proposalRef: ProposalRef;
608
+ /**
609
+ * New CRL Distribution of members of this group
610
+ *
611
+ * @readonly
612
+ */
613
+ crlNewDistributionPoints?: string[];
614
+ }
615
+ export interface WelcomeBundle {
616
+ /**
617
+ * Conversation ID
618
+ *
619
+ * @readonly
620
+ */
621
+ id: Uint8Array;
622
+ /**
623
+ * New CRL Distribution of members of this group
624
+ *
625
+ * @readonly
626
+ */
627
+ crlNewDistributionPoints?: string[];
427
628
  }
428
629
  /**
429
630
  * MLS Proposal type
@@ -540,6 +741,10 @@ export interface CoreCryptoCallbacks {
540
741
  */
541
742
  export declare class CoreCrypto {
542
743
  #private;
744
+ /**
745
+ * Should only be used internally
746
+ */
747
+ inner(): unknown;
543
748
  /**
544
749
  * This is your entrypoint to initialize {@link CoreCrypto}!
545
750
  *
@@ -573,7 +778,7 @@ export declare class CoreCrypto {
573
778
  * });
574
779
  * ````
575
780
  */
576
- static init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed }: CoreCryptoParams): Promise<CoreCrypto>;
781
+ static init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed, nbKeyPackage, }: CoreCryptoParams): Promise<CoreCrypto>;
577
782
  /**
578
783
  * Almost identical to {@link CoreCrypto.init} but allows a 2 phase initialization of MLS.
579
784
  * First, calling this will set up the keystore and will allow generating proteus prekeys.
@@ -581,14 +786,15 @@ export declare class CoreCrypto {
581
786
  * Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
582
787
  * @param params - {@link CoreCryptoDeferredParams}
583
788
  */
584
- static deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
789
+ static deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath, nbKeyPackage, }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
585
790
  /**
586
791
  * Use this after {@link CoreCrypto.deferredInit} when you have a clientId. It initializes MLS.
587
792
  *
588
793
  * @param clientId - {@link CoreCryptoParams#clientId} but required
589
794
  * @param ciphersuites - All the ciphersuites supported by this MLS client
795
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
590
796
  */
591
- mlsInit(clientId: ClientId, ciphersuites: Ciphersuite[]): Promise<void>;
797
+ mlsInit(clientId: ClientId, ciphersuites: Ciphersuite[], nbKeyPackage?: number): Promise<void>;
592
798
  /**
593
799
  * Generates a MLS KeyPair/CredentialBundle with a temporary, random client ID.
594
800
  * This method is designed to be used in conjunction with {@link CoreCrypto.mlsInitWithClientId} and represents the first step in this process
@@ -625,7 +831,7 @@ export declare class CoreCrypto {
625
831
  /**
626
832
  * Closes this {@link CoreCrypto} instance and deallocates all loaded resources
627
833
  *
628
- * **CAUTION**: This {@link CoreCrypto} instance won't be useable after a call to this method, but there's no way to express this requirement in TypeScript so you'll get errors instead!
834
+ * **CAUTION**: This {@link CoreCrypto} instance won't be usable after a call to this method, but there's no way to express this requirement in TypeScript, so you'll get errors instead!
629
835
  */
630
836
  close(): Promise<void>;
631
837
  /**
@@ -691,7 +897,12 @@ export declare class CoreCrypto {
691
897
  */
692
898
  createConversation(conversationId: ConversationId, creatorCredentialType: CredentialType, configuration?: ConversationConfiguration): Promise<any>;
693
899
  /**
694
- * Decrypts a message for a given conversation
900
+ * Decrypts a message for a given conversation.
901
+ *
902
+ * Note: you should catch & ignore the following error reasons:
903
+ * * "We already decrypted this message once"
904
+ * * "You tried to join with an external commit but did not merge it yet. We will reapply this message for you when you merge your external commit"
905
+ * * "Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives"
695
906
  *
696
907
  * @param conversationId - The ID of the conversation
697
908
  * @param payload - The encrypted message buffer
@@ -708,34 +919,26 @@ export declare class CoreCrypto {
708
919
  * @returns The encrypted payload for the given group. This needs to be fanned out to the other members of the group.
709
920
  */
710
921
  encryptMessage(conversationId: ConversationId, message: Uint8Array): Promise<Uint8Array>;
711
- /**
712
- * Updates the trust anchors for a conversation. This should be called when a federated event happens (new team added/removed).
713
- * Clients should add and/or remove trust anchors from the new backend to the conversation. The method will check
714
- * for duplicated domains and the validity of the certificate chain.
715
- *
716
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
717
- * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
718
- * epoch, use new encryption secrets etc...
719
- *
720
- * @param conversationId - The ID of the conversation
721
- * @param removeDomainNames - Domains to remove from the trust anchors
722
- * @param addTrustAnchors - New trust anchors to add to the conversation
723
- *
724
- * @returns A {@link CommitBundle}
725
- */
726
- update_trust_anchors_from_conversation(conversationId: ConversationId, removeDomainNames: string[], addTrustAnchors: PerDomainTrustAnchor[]): Promise<CommitBundle>;
727
922
  /**
728
923
  * Ingest a TLS-serialized MLS welcome message to join an existing MLS group
729
924
  *
925
+ * Important: you have to catch the error with this reason "Although this Welcome seems valid, the local KeyPackage
926
+ * it references has already been deleted locally. Join this group with an external commit", ignore it and then try
927
+ * to join this group with an external commit.
928
+ *
730
929
  * @param welcomeMessage - TLS-serialized MLS Welcome message
731
930
  * @param configuration - configuration of the MLS group
732
931
  * @returns The conversation ID of the newly joined group. You can use the same ID to decrypt/encrypt messages
733
932
  */
734
- processWelcomeMessage(welcomeMessage: Uint8Array, configuration?: CustomConfiguration): Promise<ConversationId>;
933
+ processWelcomeMessage(welcomeMessage: Uint8Array, configuration?: CustomConfiguration): Promise<WelcomeBundle>;
735
934
  /**
736
- * @returns The client's public key
935
+ * Get the client's public signature key. To upload to the DS for further backend side validation
936
+ *
937
+ * @param ciphersuite - of the signature key to get
938
+ * @param credentialType - of the public key to look for
939
+ * @returns the client's public signature key
737
940
  */
738
- clientPublicKey(ciphersuite: Ciphersuite): Promise<Uint8Array>;
941
+ clientPublicKey(ciphersuite: Ciphersuite, credentialType: CredentialType): Promise<Uint8Array>;
739
942
  /**
740
943
  *
741
944
  * @param ciphersuite - of the KeyPackages to count
@@ -762,21 +965,21 @@ export declare class CoreCrypto {
762
965
  /**
763
966
  * Adds new clients to a conversation, assuming the current client has the right to add new clients to the conversation.
764
967
  *
765
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
968
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
766
969
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
767
970
  * epoch, use new encryption secrets etc...
768
971
  *
769
972
  * @param conversationId - The ID of the conversation
770
- * @param clients - Array of {@link Invitee} (which are Client ID / KeyPackage pairs)
973
+ * @param keyPackages - KeyPackages of the new clients to add
771
974
  *
772
975
  * @returns A {@link CommitBundle}
773
976
  */
774
- addClientsToConversation(conversationId: ConversationId, clients: Invitee[]): Promise<MemberAddedMessages>;
977
+ addClientsToConversation(conversationId: ConversationId, keyPackages: Uint8Array[]): Promise<MemberAddedMessages>;
775
978
  /**
776
979
  * Removes the provided clients from a conversation; Assuming those clients exist and the current client is allowed
777
980
  * to do so, otherwise this operation does nothing.
778
981
  *
779
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
982
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
780
983
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
781
984
  * epoch, use new encryption secrets etc...
782
985
  *
@@ -787,9 +990,9 @@ export declare class CoreCrypto {
787
990
  */
788
991
  removeClientsFromConversation(conversationId: ConversationId, clientIds: ClientId[]): Promise<CommitBundle>;
789
992
  /**
790
- * Creates an update commit which forces every client to update their keypackages in the conversation
993
+ * Creates an update commit which forces every client to update their LeafNode in the conversation
791
994
  *
792
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
995
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
793
996
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
794
997
  * epoch, use new encryption secrets etc...
795
998
  *
@@ -819,6 +1022,9 @@ export declare class CoreCrypto {
819
1022
  * @returns A {@link ProposalBundle} containing the Proposal and its reference in order to roll it back if necessary
820
1023
  */
821
1024
  newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<ProposalBundle>;
1025
+ /**
1026
+ * Creates a new external Add proposal for self client to join a conversation.
1027
+ */
822
1028
  newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs): Promise<Uint8Array>;
823
1029
  /**
824
1030
  * Allows to create an external commit to "apply" to join a group through its GroupInfo.
@@ -843,8 +1049,9 @@ export declare class CoreCrypto {
843
1049
  * and deletes the temporary one. This step makes the group operational and ready to encrypt/decrypt message
844
1050
  *
845
1051
  * @param conversationId - The ID of the conversation
1052
+ * @returns eventually decrypted buffered messages if any
846
1053
  */
847
- mergePendingGroupFromExternalCommit(conversationId: ConversationId): Promise<DecryptedMessage[] | undefined>;
1054
+ mergePendingGroupFromExternalCommit(conversationId: ConversationId): Promise<BufferedDecryptedMessage[] | undefined>;
848
1055
  /**
849
1056
  * In case the external commit generated by {@link CoreCrypto.joinByExternalCommit} is rejected by the Delivery Service, and we
850
1057
  * want to abort this external commit once for all, we can wipe out the pending group from the keystore in order
@@ -854,26 +1061,24 @@ export declare class CoreCrypto {
854
1061
  */
855
1062
  clearPendingGroupFromExternalCommit(conversationId: ConversationId): Promise<void>;
856
1063
  /**
857
- * Allows to mark the latest commit produced as "accepted" and be able to safely merge it
858
- * into the local group state
1064
+ * Allows to mark the latest commit produced as "accepted" and be able to safely merge it into the local group state
859
1065
  *
860
1066
  * @param conversationId - The group's ID
1067
+ * @returns the messages from current epoch which had been buffered, if any
861
1068
  */
862
- commitAccepted(conversationId: ConversationId): Promise<void>;
1069
+ commitAccepted(conversationId: ConversationId): Promise<BufferedDecryptedMessage[] | undefined>;
863
1070
  /**
864
- * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions
865
- * have changed meanwhile.
1071
+ * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions have changed meanwhile.
866
1072
  *
867
1073
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
868
- * e.g. 403 or 409. Do not use otherwise e.g. 5xx responses, timeout etc..
1074
+ * e.g. 403 or 409. Do not use otherwise e.g. 5xx responses, timeout etc
869
1075
  *
870
1076
  * @param conversationId - The group's ID
871
1077
  * @param proposalRef - A reference to the proposal to delete. You get one when using {@link CoreCrypto.newProposal}
872
1078
  */
873
1079
  clearPendingProposal(conversationId: ConversationId, proposalRef: ProposalRef): Promise<void>;
874
1080
  /**
875
- * Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions
876
- * have changed meanwhile.
1081
+ * Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions have changed meanwhile.
877
1082
  *
878
1083
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
879
1084
  * e.g. 403. Do not use otherwise e.g. 5xx responses, timeout etc..
@@ -893,6 +1098,15 @@ export declare class CoreCrypto {
893
1098
  * @returns A `Uint8Array` representing the derived key
894
1099
  */
895
1100
  exportSecretKey(conversationId: ConversationId, keyLength: number): Promise<Uint8Array>;
1101
+ /**
1102
+ * Returns the raw public key of the single external sender present in this group.
1103
+ * This should be used to initialize a subconversation
1104
+ *
1105
+ * @param conversationId - The group's ID
1106
+ *
1107
+ * @returns A `Uint8Array` representing the external sender raw public key
1108
+ */
1109
+ getExternalSender(conversationId: ConversationId): Promise<Uint8Array>;
896
1110
  /**
897
1111
  * Returns all clients from group's members
898
1112
  *
@@ -917,7 +1131,7 @@ export declare class CoreCrypto {
917
1131
  */
918
1132
  reseedRng(seed: Uint8Array): Promise<void>;
919
1133
  /**
920
- * Initiailizes the proteus client
1134
+ * Initializes the proteus client
921
1135
  */
922
1136
  proteusInit(): Promise<void>;
923
1137
  /**
@@ -1050,47 +1264,91 @@ export declare class CoreCrypto {
1050
1264
  * Creates an enrollment instance with private key material you can use in order to fetch
1051
1265
  * a new x509 certificate from the acme server.
1052
1266
  *
1053
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1054
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
1055
- * @param handle user handle e.g. `alice.smith.qa@example.com`
1056
- * @param expiryDays generated x509 certificate expiry
1267
+ * @param clientId - client identifier e.g. `b7ac11a4-8f01-4527-af88-1c30885a7931:6add501bacd1d90e@example.com`
1268
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1269
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
1270
+ * @param expirySec - generated x509 certificate expiry
1057
1271
  * @param ciphersuite - for generating signing key material
1058
- * @returns The new {@link WireE2eIdentity} object
1272
+ * @param team - name of the Wire team a user belongs to
1273
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiMlsInitOnly}
1059
1274
  */
1060
- e2eiNewEnrollment(clientId: string, displayName: string, handle: string, expiryDays: number, ciphersuite: Ciphersuite): Promise<WireE2eIdentity>;
1275
+ e2eiNewEnrollment(clientId: string, displayName: string, handle: string, expirySec: number, ciphersuite: Ciphersuite, team?: string): Promise<E2eiEnrollment>;
1061
1276
  /**
1062
1277
  * Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI.
1063
1278
  * Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
1064
1279
  *
1065
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1066
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
1067
- * @param handle user handle e.g. `alice.smith.qa@example.com`
1068
- * @param expiryDays generated x509 certificate expiry
1280
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1281
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
1282
+ * @param expirySec - generated x509 certificate expiry
1069
1283
  * @param ciphersuite - for generating signing key material
1070
- * @returns The new {@link WireE2eIdentity} object
1284
+ * @param team - name of the Wire team a user belongs to
1285
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiRotateAll}
1071
1286
  */
1072
- e2eiNewActivationEnrollment(clientId: string, displayName: string, handle: string, expiryDays: number, ciphersuite: Ciphersuite): Promise<WireE2eIdentity>;
1287
+ e2eiNewActivationEnrollment(displayName: string, handle: string, expirySec: number, ciphersuite: Ciphersuite, team?: string): Promise<E2eiEnrollment>;
1073
1288
  /**
1074
1289
  * Generates an E2EI enrollment instance for a E2EI client (with a X509 certificate credential)
1075
1290
  * having to change/rotate their credential, either because the former one is expired or it
1076
1291
  * has been revoked. It lets you change the DisplayName or the handle
1077
1292
  * if you need to. Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
1078
1293
  *
1079
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1080
- * @param expiryDays generated x509 certificate expiry
1294
+ * @param expirySec - generated x509 certificate expiry
1081
1295
  * @param ciphersuite - for generating signing key material
1082
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
1083
- * @param handle user handle e.g. `alice.smith.qa@example.com`
1084
- * @returns The new {@link WireE2eIdentity} object
1296
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1297
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
1298
+ * @param team - name of the Wire team a user belongs to
1299
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiRotateAll}
1085
1300
  */
1086
- e2eiNewRotateEnrollment(clientId: string, expiryDays: number, ciphersuite: Ciphersuite, displayName?: string, handle?: string): Promise<WireE2eIdentity>;
1301
+ e2eiNewRotateEnrollment(expirySec: number, ciphersuite: Ciphersuite, displayName?: string, handle?: string, team?: string): Promise<E2eiEnrollment>;
1087
1302
  /**
1088
- * 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
1303
+ * Use this method to initialize end-to-end identity when a client signs up and the grace period is already expired ;
1304
+ * that means he cannot initialize with a Basic credential
1089
1305
  *
1090
1306
  * @param enrollment - the enrollment instance used to fetch the certificates
1091
1307
  * @param certificateChain - the raw response from ACME server
1308
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
1309
+ * @returns a MlsClient initialized with only a x509 credential
1310
+ */
1311
+ e2eiMlsInitOnly(enrollment: E2eiEnrollment, certificateChain: string, nbKeyPackage?: number): Promise<string[] | undefined>;
1312
+ /**
1313
+ * Dumps the PKI environment as PEM
1314
+ *
1315
+ * @returns a struct with different fields representing the PKI environment as PEM strings
1092
1316
  */
1093
- e2eiMlsInitOnly(enrollment: WireE2eIdentity, certificateChain: string): Promise<void>;
1317
+ e2eiDumpPKIEnv(): Promise<E2eiDumpedPkiEnv | undefined>;
1318
+ /**
1319
+ * @returns whether the E2EI PKI environment is setup (i.e. Root CA, Intermediates, CRLs)
1320
+ */
1321
+ e2eiIsPKIEnvSetup(): Promise<boolean>;
1322
+ /**
1323
+ * Registers a Root Trust Anchor CA for the use in E2EI processing.
1324
+ *
1325
+ * Please note that without a Root Trust Anchor, all validations *will* fail;
1326
+ * So this is the first step to perform after initializing your E2EI client
1327
+ *
1328
+ * @param trustAnchorPEM - PEM certificate to anchor as a Trust Root
1329
+ */
1330
+ e2eiRegisterAcmeCA(trustAnchorPEM: string): Promise<void>;
1331
+ /**
1332
+ * Registers an Intermediate CA for the use in E2EI processing.
1333
+ *
1334
+ * Please note that a Root Trust Anchor CA is needed to validate Intermediate CAs;
1335
+ * You **need** to have a Root CA registered before calling this
1336
+ *
1337
+ * @param certPEM - PEM certificate to register as an Intermediate CA
1338
+ */
1339
+ e2eiRegisterIntermediateCA(certPEM: string): Promise<string[] | undefined>;
1340
+ /**
1341
+ * Registers a CRL for the use in E2EI processing.
1342
+ *
1343
+ * Please note that a Root Trust Anchor CA is needed to validate CRLs;
1344
+ * You **need** to have a Root CA registered before calling this
1345
+ *
1346
+ * @param crlDP - CRL Distribution Point; Basically the URL you fetched it from
1347
+ * @param crlDER - DER representation of the CRL
1348
+ *
1349
+ * @returns a {@link CRLRegistration} with the dirty state of the new CRL (see struct) and its expiration timestamp
1350
+ */
1351
+ e2eiRegisterCRL(crlDP: string, crlDER: Uint8Array): Promise<CRLRegistration>;
1094
1352
  /**
1095
1353
  * Creates a commit in all local conversations for changing the credential. Requires first
1096
1354
  * having enrolled a new X509 certificate with either {@link CoreCrypto.e2eiNewActivationEnrollment}
@@ -1099,8 +1357,9 @@ export declare class CoreCrypto {
1099
1357
  * @param enrollment - the enrollment instance used to fetch the certificates
1100
1358
  * @param certificateChain - the raw response from ACME server
1101
1359
  * @param newKeyPackageCount - number of KeyPackages with new identity to generate
1360
+ * @returns a {@link RotateBundle} with commits to fan-out to other group members, KeyPackages to upload and old ones to delete
1102
1361
  */
1103
- e2eiRotateAll(enrollment: WireE2eIdentity, certificateChain: string, newKeyPackageCount: number): Promise<RotateBundle>;
1362
+ e2eiRotateAll(enrollment: E2eiEnrollment, certificateChain: string, newKeyPackageCount: number): Promise<RotateBundle>;
1104
1363
  /**
1105
1364
  * Allows persisting an active enrollment (for example while redirecting the user during OAuth) in order to resume
1106
1365
  * it later with {@link e2eiEnrollmentStashPop}
@@ -1108,16 +1367,16 @@ export declare class CoreCrypto {
1108
1367
  * @param enrollment the enrollment instance to persist
1109
1368
  * @returns a handle to fetch the enrollment later with {@link e2eiEnrollmentStashPop}
1110
1369
  */
1111
- e2eiEnrollmentStash(enrollment: WireE2eIdentity): Promise<Uint8Array>;
1370
+ e2eiEnrollmentStash(enrollment: E2eiEnrollment): Promise<Uint8Array>;
1112
1371
  /**
1113
1372
  * Fetches the persisted enrollment and deletes it from the keystore
1114
1373
  *
1115
1374
  * @param handle returned by {@link e2eiEnrollmentStash}
1116
1375
  * @returns the persisted enrollment instance
1117
1376
  */
1118
- e2eiEnrollmentStashPop(handle: Uint8Array): Promise<WireE2eIdentity>;
1377
+ e2eiEnrollmentStashPop(handle: Uint8Array): Promise<E2eiEnrollment>;
1119
1378
  /**
1120
- * Indicates when to mark a conversation as degraded i.e. when not all its members have a X509.
1379
+ * Indicates when to mark a conversation as not verified i.e. when not all its members have a X509.
1121
1380
  * Credential generated by Wire's end-to-end identity enrollment
1122
1381
  *
1123
1382
  * @param conversationId The group's ID
@@ -1128,9 +1387,37 @@ export declare class CoreCrypto {
1128
1387
  * Returns true when end-to-end-identity is enabled for the given Ciphersuite
1129
1388
  *
1130
1389
  * @param ciphersuite of the credential to check
1131
- * @returns true end-to-end identity is enabled for the given ciphersuite
1390
+ * @returns true if end-to-end identity is enabled for the given ciphersuite
1132
1391
  */
1133
1392
  e2eiIsEnabled(ciphersuite: Ciphersuite): Promise<boolean>;
1393
+ /**
1394
+ * From a given conversation, get the identity of the members supplied. Identity is only present for members with a
1395
+ * Certificate Credential (after turning on end-to-end identity).
1396
+ *
1397
+ * @param conversationId - identifier of the conversation
1398
+ * @param deviceIds - identifiers of the devices
1399
+ * @returns identities or if no member has a x509 certificate, it will return an empty List
1400
+ */
1401
+ getDeviceIdentities(conversationId: ConversationId, deviceIds: ClientId[]): Promise<WireIdentity[]>;
1402
+ /**
1403
+ * From a given conversation, get the identity of the users (device holders) supplied.
1404
+ * Identity is only present for devices with a Certificate Credential (after turning on end-to-end identity).
1405
+ * If no member has a x509 certificate, it will return an empty Vec.
1406
+ *
1407
+ * @param conversationId - identifier of the conversation
1408
+ * @param userIds - user identifiers hyphenated UUIDv4 e.g. 'bd4c7053-1c5a-4020-9559-cd7bf7961954'
1409
+ * @returns a Map with all the identities for a given users. Consumers are then recommended to reduce those identities to determine the actual status of a user.
1410
+ */
1411
+ getUserIdentities(conversationId: ConversationId, userIds: string[]): Promise<Map<string, WireIdentity[]>>;
1412
+ /**
1413
+ * Gets the e2ei conversation state from a `GroupInfo`. Useful to check if the group has e2ei
1414
+ * turned on or not before joining it.
1415
+ *
1416
+ * @param groupInfo - a TLS encoded GroupInfo fetched from the Delivery Service
1417
+ * @param credentialType - kind of Credential to check usage of. Defaults to X509 for now as no other value will give any result.
1418
+ * @returns see {@link E2eiConversationState}
1419
+ */
1420
+ getCredentialInUse(groupInfo: Uint8Array, credentialType?: CredentialType): Promise<E2eiConversationState>;
1134
1421
  /**
1135
1422
  * Returns the current version of {@link CoreCrypto}
1136
1423
  *
@@ -1139,7 +1426,7 @@ export declare class CoreCrypto {
1139
1426
  static version(): string;
1140
1427
  }
1141
1428
  type JsonRawData = Uint8Array;
1142
- export declare class WireE2eIdentity {
1429
+ export declare class E2eiEnrollment {
1143
1430
  #private;
1144
1431
  /** @hidden */
1145
1432
  constructor(e2ei: unknown);
@@ -1156,7 +1443,7 @@ export declare class WireE2eIdentity {
1156
1443
  * @param directory HTTP response body
1157
1444
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
1158
1445
  */
1159
- directoryResponse(directory: JsonRawData): AcmeDirectory;
1446
+ directoryResponse(directory: JsonRawData): Promise<AcmeDirectory>;
1160
1447
  /**
1161
1448
  * For creating a new acme account. This returns a signed JWS-alike request body to send to
1162
1449
  * `POST /acme/{provisioner-name}/new-account`.
@@ -1164,27 +1451,27 @@ export declare class WireE2eIdentity {
1164
1451
  * @param previousNonce you got from calling `HEAD {@link AcmeDirectory.newNonce}`
1165
1452
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
1166
1453
  */
1167
- newAccountRequest(previousNonce: string): JsonRawData;
1454
+ newAccountRequest(previousNonce: string): Promise<JsonRawData>;
1168
1455
  /**
1169
1456
  * Parses the response from `POST /acme/{provisioner-name}/new-account`.
1170
1457
  * @param account HTTP response body
1171
1458
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
1172
1459
  */
1173
- newAccountResponse(account: JsonRawData): void;
1460
+ newAccountResponse(account: JsonRawData): Promise<void>;
1174
1461
  /**
1175
1462
  * Creates a new acme order for the handle (userId + display name) and the clientId.
1176
1463
  *
1177
1464
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-account`
1178
1465
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1179
1466
  */
1180
- newOrderRequest(previousNonce: string): JsonRawData;
1467
+ newOrderRequest(previousNonce: string): Promise<JsonRawData>;
1181
1468
  /**
1182
1469
  * Parses the response from `POST /acme/{provisioner-name}/new-order`.
1183
1470
  *
1184
1471
  * @param order HTTP response body
1185
1472
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1186
1473
  */
1187
- newOrderResponse(order: JsonRawData): NewAcmeOrder;
1474
+ newOrderResponse(order: JsonRawData): Promise<NewAcmeOrder>;
1188
1475
  /**
1189
1476
  * Creates a new authorization request.
1190
1477
  *
@@ -1193,14 +1480,14 @@ export declare class WireE2eIdentity {
1193
1480
  * previous to this method if you are creating the second authorization)
1194
1481
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1195
1482
  */
1196
- newAuthzRequest(url: string, previousNonce: string): JsonRawData;
1483
+ newAuthzRequest(url: string, previousNonce: string): Promise<JsonRawData>;
1197
1484
  /**
1198
1485
  * Parses the response from `POST /acme/{provisioner-name}/authz/{authz-id}`
1199
1486
  *
1200
1487
  * @param authz HTTP response body
1201
1488
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1202
1489
  */
1203
- newAuthzResponse(authz: JsonRawData): NewAcmeAuthz;
1490
+ newAuthzResponse(authz: JsonRawData): Promise<NewAcmeAuthz>;
1204
1491
  /**
1205
1492
  * Generates a new client Dpop JWT token. It demonstrates proof of possession of the nonces
1206
1493
  * (from wire-server & acme server) and will be verified by the acme server when verifying the
@@ -1212,7 +1499,7 @@ export declare class WireE2eIdentity {
1212
1499
  * @param expirySecs of the client Dpop JWT. This should be equal to the grace period set in Team Management
1213
1500
  * @param backendNonce you get by calling `GET /clients/token/nonce` on wire-server as defined here {@link https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/get_clients__client__nonce}
1214
1501
  */
1215
- createDpopToken(expirySecs: number, backendNonce: string): Uint8Array;
1502
+ createDpopToken(expirySecs: number, backendNonce: string): Promise<Uint8Array>;
1216
1503
  /**
1217
1504
  * Creates a new challenge request for Wire Dpop challenge.
1218
1505
  *
@@ -1220,7 +1507,14 @@ export declare class WireE2eIdentity {
1220
1507
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
1221
1508
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1222
1509
  */
1223
- newDpopChallengeRequest(accessToken: string, previousNonce: string): JsonRawData;
1510
+ newDpopChallengeRequest(accessToken: string, previousNonce: string): Promise<JsonRawData>;
1511
+ /**
1512
+ * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}` for the DPoP challenge.
1513
+ *
1514
+ * @param challenge HTTP response body
1515
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1516
+ */
1517
+ newDpopChallengeResponse(challenge: JsonRawData): Promise<void>;
1224
1518
  /**
1225
1519
  * Creates a new challenge request for Wire Oidc challenge.
1226
1520
  *
@@ -1228,14 +1522,15 @@ export declare class WireE2eIdentity {
1228
1522
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
1229
1523
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1230
1524
  */
1231
- newOidcChallengeRequest(idToken: string, previousNonce: string): JsonRawData;
1525
+ newOidcChallengeRequest(idToken: string, previousNonce: string): Promise<JsonRawData>;
1232
1526
  /**
1233
- * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}`.
1527
+ * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}` for the OIDC challenge.
1234
1528
  *
1529
+ * @param cc the CoreCrypto instance
1235
1530
  * @param challenge HTTP response body
1236
1531
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1237
1532
  */
1238
- newChallengeResponse(challenge: JsonRawData): void;
1533
+ newOidcChallengeResponse(challenge: JsonRawData): Promise<void>;
1239
1534
  /**
1240
1535
  * Verifies that the previous challenge has been completed.
1241
1536
  *
@@ -1243,22 +1538,22 @@ export declare class WireE2eIdentity {
1243
1538
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
1244
1539
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1245
1540
  */
1246
- checkOrderRequest(orderUrl: string, previousNonce: string): JsonRawData;
1541
+ checkOrderRequest(orderUrl: string, previousNonce: string): Promise<JsonRawData>;
1247
1542
  /**
1248
1543
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}`.
1249
1544
  *
1250
1545
  * @param order HTTP response body
1251
- * @return the finalize url to use with {@link finalizeRequest}
1546
+ * @return finalize url to use with {@link finalizeRequest}
1252
1547
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1253
1548
  */
1254
- checkOrderResponse(order: JsonRawData): string;
1549
+ checkOrderResponse(order: JsonRawData): Promise<string>;
1255
1550
  /**
1256
1551
  * Final step before fetching the certificate.
1257
1552
  *
1258
1553
  * @param previousNonce - `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
1259
1554
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1260
1555
  */
1261
- finalizeRequest(previousNonce: string): JsonRawData;
1556
+ finalizeRequest(previousNonce: string): Promise<JsonRawData>;
1262
1557
  /**
1263
1558
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}/finalize`.
1264
1559
  *
@@ -1266,105 +1561,14 @@ export declare class WireE2eIdentity {
1266
1561
  * @return the certificate url to use with {@link certificateRequest}
1267
1562
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1268
1563
  */
1269
- finalizeResponse(finalize: JsonRawData): string;
1564
+ finalizeResponse(finalize: JsonRawData): Promise<string>;
1270
1565
  /**
1271
1566
  * Creates a request for finally fetching the x509 certificate.
1272
1567
  *
1273
1568
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}/finalize`
1274
1569
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
1275
1570
  */
1276
- certificateRequest(previousNonce: string): JsonRawData;
1277
- }
1278
- /**
1279
- * Holds URLs of all the standard ACME endpoint supported on an ACME server.
1280
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
1281
- */
1282
- export interface AcmeDirectory {
1283
- /**
1284
- * URL for fetching a new nonce. Use this only for creating a new account.
1285
- *
1286
- * @readonly
1287
- */
1288
- newNonce: string;
1289
- /**
1290
- * URL for creating a new account.
1291
- *
1292
- * @readonly
1293
- */
1294
- newAccount: string;
1295
- /**
1296
- * URL for creating a new order.
1297
- *
1298
- * @readonly
1299
- */
1300
- newOrder: string;
1301
- }
1302
- /**
1303
- * Result of an order creation
1304
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1305
- */
1306
- export interface NewAcmeOrder {
1307
- /**
1308
- * Contains raw JSON data of this order. This is parsed by the underlying Rust library hence should not be accessed
1309
- *
1310
- * @readonly
1311
- */
1312
- delegate: Uint8Array;
1313
- /**
1314
- * An authorization for each domain to create
1315
- *
1316
- * @readonly
1317
- */
1318
- authorizations: Uint8Array[];
1319
- }
1320
- /**
1321
- * Result of an authorization creation.
1322
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1323
- */
1324
- export interface NewAcmeAuthz {
1325
- /**
1326
- * DNS entry associated with those challenge
1327
- *
1328
- * @readonly
1329
- */
1330
- identifier: string;
1331
- /**
1332
- * Challenge for the clientId
1333
- *
1334
- * @readonly
1335
- */
1336
- wireDpopChallenge?: AcmeChallenge;
1337
- /**
1338
- * Challenge for the userId and displayName
1339
- *
1340
- * @readonly
1341
- */
1342
- wireOidcChallenge?: AcmeChallenge;
1343
- }
1344
- /**
1345
- * For creating a challenge
1346
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1347
- */
1348
- export interface AcmeChallenge {
1349
- /**
1350
- * Contains raw JSON data of this challenge. This is parsed by the underlying Rust library hence should not be accessed
1351
- *
1352
- * @readonly
1353
- */
1354
- delegate: Uint8Array;
1355
- /**
1356
- * URL of this challenge
1357
- *
1358
- * @readonly
1359
- */
1360
- url: string;
1361
- /**
1362
- * Non-standard, Wire specific claim. Indicates the consumer from where it should get the challenge proof.
1363
- * Either from wire-server "/access-token" endpoint in case of a DPoP challenge, or from an OAuth token endpoint for an OIDC challenge
1364
- *
1365
- * @readonly
1366
- */
1367
- target: string;
1571
+ certificateRequest(previousNonce: string): Promise<JsonRawData>;
1368
1572
  }
1369
1573
  /**
1370
1574
  * Indicates the state of a Conversation regarding end-to-end identity.
@@ -1379,9 +1583,9 @@ export declare enum E2eiConversationState {
1379
1583
  /**
1380
1584
  * Some clients are either still Basic or their certificate is expired
1381
1585
  */
1382
- Degraded = 2,
1586
+ NotVerified = 2,
1383
1587
  /**
1384
- * All clients are still Basic. If all client have expired certificates, Degraded is returned.
1588
+ * All clients are still Basic. If all client have expired certificates, NotVerified is returned.
1385
1589
  */
1386
1590
  NotEnabled = 3
1387
1591
  }