@wireapp/core-crypto 1.0.0-rc.6 → 1.0.0-rc.60

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
@@ -290,10 +351,6 @@ export interface CoreCryptoDeferredParams {
290
351
  * This should be appropriately stored in a secure location (i.e. WebCrypto private key storage)
291
352
  */
292
353
  key: string;
293
- /**
294
- * All the ciphersuites this MLS client can support
295
- */
296
- ciphersuites: Ciphersuite[];
297
354
  /**
298
355
  * External PRNG entropy pool seed.
299
356
  * This **must** be exactly 32 bytes
@@ -314,19 +371,14 @@ export interface CoreCryptoParams extends CoreCryptoDeferredParams {
314
371
  * This should stay consistent as it will be verified against the stored signature & identity to validate the persisted credential
315
372
  */
316
373
  clientId: ClientId;
317
- }
318
- /**
319
- * Data shape for adding clients to a conversation
320
- */
321
- export interface Invitee {
322
374
  /**
323
- * Client ID as a byte array
375
+ * All the ciphersuites this MLS client can support
324
376
  */
325
- id: ClientId;
377
+ ciphersuites: Ciphersuite[];
326
378
  /**
327
- * MLS KeyPackage belonging to the aforementioned client
379
+ * Number of initial KeyPackage to create when initializing the client
328
380
  */
329
- kp: Uint8Array;
381
+ nbKeyPackage?: number;
330
382
  }
331
383
  export interface ConversationInitBundle {
332
384
  /**
@@ -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,86 @@ 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[];
389
472
  }
390
473
  /**
391
- * Represents the identity claims identifying a client. Those claims are verifiable by any member in the group
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[];
509
+ }
510
+ /**
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
+ * Status of the Credential at the moment T when this object is created
521
+ */
522
+ status: DeviceStatus;
523
+ /**
524
+ * MLS thumbprint
525
+ */
526
+ thumbprint: string;
527
+ /**
528
+ * Indicates whether the credential is Basic or X509
529
+ */
530
+ credentialType: CredentialType;
531
+ /**
532
+ * In case {@link credentialType} is {@link CredentialType.X509} this is populated
533
+ */
534
+ x509Identity?: X509Identity;
535
+ }
536
+ /**
537
+ * Represents the parts of {@link WireIdentity} that are specific to a X509 certificate (and not a Basic one).
538
+ */
539
+ export interface X509Identity {
540
+ /**
541
+ * User handle e.g. `john_wire`
400
542
  */
401
543
  handle: string;
402
544
  /**
@@ -407,6 +549,58 @@ export interface WireIdentity {
407
549
  * DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
408
550
  */
409
551
  domain: string;
552
+ /**
553
+ * X509 certificate identifying this client in the MLS group ; PEM encoded
554
+ */
555
+ certificate: string;
556
+ /**
557
+ * X509 certificate serial number
558
+ */
559
+ serialNumber: string;
560
+ /**
561
+ * X509 certificate not before as Unix timestamp
562
+ */
563
+ notBefore: bigint;
564
+ /**
565
+ * X509 certificate not after as Unix timestamp
566
+ */
567
+ notAfter: bigint;
568
+ }
569
+ export interface AcmeDirectory {
570
+ /**
571
+ * URL for fetching a new nonce. Use this only for creating a new account.
572
+ */
573
+ newNonce: string;
574
+ /**
575
+ * URL for creating a new account.
576
+ */
577
+ newAccount: string;
578
+ /**
579
+ * URL for creating a new order.
580
+ */
581
+ newOrder: string;
582
+ /**
583
+ * Revocation URL
584
+ */
585
+ revokeCert: string;
586
+ }
587
+ /**
588
+ * Indicates the standalone status of a device Credential in a MLS group at a moment T.
589
+ * This does not represent the states where a device is not using MLS or is not using end-to-end identity
590
+ */
591
+ export declare enum DeviceStatus {
592
+ /**
593
+ * All is fine
594
+ */
595
+ Valid = 1,
596
+ /**
597
+ * The Credential's certificate is expired
598
+ */
599
+ Expired = 2,
600
+ /**
601
+ * The Credential's certificate is revoked
602
+ */
603
+ Revoked = 3
410
604
  }
411
605
  /**
412
606
  * Returned by all methods creating proposals. Contains a proposal message and an identifier to roll back the proposal
@@ -424,6 +618,26 @@ export interface ProposalBundle {
424
618
  * @readonly
425
619
  */
426
620
  proposalRef: ProposalRef;
621
+ /**
622
+ * New CRL Distribution of members of this group
623
+ *
624
+ * @readonly
625
+ */
626
+ crlNewDistributionPoints?: string[];
627
+ }
628
+ export interface WelcomeBundle {
629
+ /**
630
+ * Conversation ID
631
+ *
632
+ * @readonly
633
+ */
634
+ id: Uint8Array;
635
+ /**
636
+ * New CRL Distribution of members of this group
637
+ *
638
+ * @readonly
639
+ */
640
+ crlNewDistributionPoints?: string[];
427
641
  }
428
642
  /**
429
643
  * MLS Proposal type
@@ -540,6 +754,10 @@ export interface CoreCryptoCallbacks {
540
754
  */
541
755
  export declare class CoreCrypto {
542
756
  #private;
757
+ /**
758
+ * Should only be used internally
759
+ */
760
+ inner(): unknown;
543
761
  /**
544
762
  * This is your entrypoint to initialize {@link CoreCrypto}!
545
763
  *
@@ -573,7 +791,7 @@ export declare class CoreCrypto {
573
791
  * });
574
792
  * ````
575
793
  */
576
- static init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed }: CoreCryptoParams): Promise<CoreCrypto>;
794
+ static init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed, nbKeyPackage, }: CoreCryptoParams): Promise<CoreCrypto>;
577
795
  /**
578
796
  * Almost identical to {@link CoreCrypto.init} but allows a 2 phase initialization of MLS.
579
797
  * First, calling this will set up the keystore and will allow generating proteus prekeys.
@@ -581,14 +799,15 @@ export declare class CoreCrypto {
581
799
  * Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
582
800
  * @param params - {@link CoreCryptoDeferredParams}
583
801
  */
584
- static deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
802
+ static deferredInit({ databaseName, key, entropySeed, wasmFilePath, }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
585
803
  /**
586
804
  * Use this after {@link CoreCrypto.deferredInit} when you have a clientId. It initializes MLS.
587
805
  *
588
806
  * @param clientId - {@link CoreCryptoParams#clientId} but required
589
807
  * @param ciphersuites - All the ciphersuites supported by this MLS client
808
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
590
809
  */
591
- mlsInit(clientId: ClientId, ciphersuites: Ciphersuite[]): Promise<void>;
810
+ mlsInit(clientId: ClientId, ciphersuites: Ciphersuite[], nbKeyPackage?: number): Promise<void>;
592
811
  /**
593
812
  * Generates a MLS KeyPair/CredentialBundle with a temporary, random client ID.
594
813
  * This method is designed to be used in conjunction with {@link CoreCrypto.mlsInitWithClientId} and represents the first step in this process
@@ -625,7 +844,7 @@ export declare class CoreCrypto {
625
844
  /**
626
845
  * Closes this {@link CoreCrypto} instance and deallocates all loaded resources
627
846
  *
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!
847
+ * **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
848
  */
630
849
  close(): Promise<void>;
631
850
  /**
@@ -691,7 +910,12 @@ export declare class CoreCrypto {
691
910
  */
692
911
  createConversation(conversationId: ConversationId, creatorCredentialType: CredentialType, configuration?: ConversationConfiguration): Promise<any>;
693
912
  /**
694
- * Decrypts a message for a given conversation
913
+ * Decrypts a message for a given conversation.
914
+ *
915
+ * Note: you should catch & ignore the following error reasons:
916
+ * * "We already decrypted this message once"
917
+ * * "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"
918
+ * * "Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives"
695
919
  *
696
920
  * @param conversationId - The ID of the conversation
697
921
  * @param payload - The encrypted message buffer
@@ -708,22 +932,6 @@ export declare class CoreCrypto {
708
932
  * @returns The encrypted payload for the given group. This needs to be fanned out to the other members of the group.
709
933
  */
710
934
  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
935
  /**
728
936
  * Ingest a TLS-serialized MLS welcome message to join an existing MLS group
729
937
  *
@@ -735,11 +943,15 @@ export declare class CoreCrypto {
735
943
  * @param configuration - configuration of the MLS group
736
944
  * @returns The conversation ID of the newly joined group. You can use the same ID to decrypt/encrypt messages
737
945
  */
738
- processWelcomeMessage(welcomeMessage: Uint8Array, configuration?: CustomConfiguration): Promise<ConversationId>;
946
+ processWelcomeMessage(welcomeMessage: Uint8Array, configuration?: CustomConfiguration): Promise<WelcomeBundle>;
739
947
  /**
740
- * @returns The client's public key
948
+ * Get the client's public signature key. To upload to the DS for further backend side validation
949
+ *
950
+ * @param ciphersuite - of the signature key to get
951
+ * @param credentialType - of the public key to look for
952
+ * @returns the client's public signature key
741
953
  */
742
- clientPublicKey(ciphersuite: Ciphersuite): Promise<Uint8Array>;
954
+ clientPublicKey(ciphersuite: Ciphersuite, credentialType: CredentialType): Promise<Uint8Array>;
743
955
  /**
744
956
  *
745
957
  * @param ciphersuite - of the KeyPackages to count
@@ -766,21 +978,21 @@ export declare class CoreCrypto {
766
978
  /**
767
979
  * Adds new clients to a conversation, assuming the current client has the right to add new clients to the conversation.
768
980
  *
769
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
981
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
770
982
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
771
983
  * epoch, use new encryption secrets etc...
772
984
  *
773
985
  * @param conversationId - The ID of the conversation
774
- * @param clients - Array of {@link Invitee} (which are Client ID / KeyPackage pairs)
986
+ * @param keyPackages - KeyPackages of the new clients to add
775
987
  *
776
988
  * @returns A {@link CommitBundle}
777
989
  */
778
- addClientsToConversation(conversationId: ConversationId, clients: Invitee[]): Promise<MemberAddedMessages>;
990
+ addClientsToConversation(conversationId: ConversationId, keyPackages: Uint8Array[]): Promise<MemberAddedMessages>;
779
991
  /**
780
992
  * Removes the provided clients from a conversation; Assuming those clients exist and the current client is allowed
781
993
  * to do so, otherwise this operation does nothing.
782
994
  *
783
- * **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
784
996
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
785
997
  * epoch, use new encryption secrets etc...
786
998
  *
@@ -791,9 +1003,9 @@ export declare class CoreCrypto {
791
1003
  */
792
1004
  removeClientsFromConversation(conversationId: ConversationId, clientIds: ClientId[]): Promise<CommitBundle>;
793
1005
  /**
794
- * Creates an update commit which forces every client to update their keypackages in the conversation
1006
+ * Creates an update commit which forces every client to update their LeafNode in the conversation
795
1007
  *
796
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
1008
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
797
1009
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
798
1010
  * epoch, use new encryption secrets etc...
799
1011
  *
@@ -823,6 +1035,9 @@ export declare class CoreCrypto {
823
1035
  * @returns A {@link ProposalBundle} containing the Proposal and its reference in order to roll it back if necessary
824
1036
  */
825
1037
  newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<ProposalBundle>;
1038
+ /**
1039
+ * Creates a new external Add proposal for self client to join a conversation.
1040
+ */
826
1041
  newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs): Promise<Uint8Array>;
827
1042
  /**
828
1043
  * Allows to create an external commit to "apply" to join a group through its GroupInfo.
@@ -847,8 +1062,9 @@ export declare class CoreCrypto {
847
1062
  * and deletes the temporary one. This step makes the group operational and ready to encrypt/decrypt message
848
1063
  *
849
1064
  * @param conversationId - The ID of the conversation
1065
+ * @returns eventually decrypted buffered messages if any
850
1066
  */
851
- mergePendingGroupFromExternalCommit(conversationId: ConversationId): Promise<DecryptedMessage[] | undefined>;
1067
+ mergePendingGroupFromExternalCommit(conversationId: ConversationId): Promise<BufferedDecryptedMessage[] | undefined>;
852
1068
  /**
853
1069
  * In case the external commit generated by {@link CoreCrypto.joinByExternalCommit} is rejected by the Delivery Service, and we
854
1070
  * want to abort this external commit once for all, we can wipe out the pending group from the keystore in order
@@ -858,26 +1074,24 @@ export declare class CoreCrypto {
858
1074
  */
859
1075
  clearPendingGroupFromExternalCommit(conversationId: ConversationId): Promise<void>;
860
1076
  /**
861
- * Allows to mark the latest commit produced as "accepted" and be able to safely merge it
862
- * into the local group state
1077
+ * Allows to mark the latest commit produced as "accepted" and be able to safely merge it into the local group state
863
1078
  *
864
1079
  * @param conversationId - The group's ID
1080
+ * @returns the messages from current epoch which had been buffered, if any
865
1081
  */
866
- commitAccepted(conversationId: ConversationId): Promise<void>;
1082
+ commitAccepted(conversationId: ConversationId): Promise<BufferedDecryptedMessage[] | undefined>;
867
1083
  /**
868
- * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions
869
- * have changed meanwhile.
1084
+ * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions have changed meanwhile.
870
1085
  *
871
1086
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
872
- * e.g. 403 or 409. Do not use otherwise e.g. 5xx responses, timeout etc..
1087
+ * e.g. 403 or 409. Do not use otherwise e.g. 5xx responses, timeout etc
873
1088
  *
874
1089
  * @param conversationId - The group's ID
875
1090
  * @param proposalRef - A reference to the proposal to delete. You get one when using {@link CoreCrypto.newProposal}
876
1091
  */
877
1092
  clearPendingProposal(conversationId: ConversationId, proposalRef: ProposalRef): Promise<void>;
878
1093
  /**
879
- * Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions
880
- * have changed meanwhile.
1094
+ * Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions have changed meanwhile.
881
1095
  *
882
1096
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
883
1097
  * e.g. 403. Do not use otherwise e.g. 5xx responses, timeout etc..
@@ -897,6 +1111,15 @@ export declare class CoreCrypto {
897
1111
  * @returns A `Uint8Array` representing the derived key
898
1112
  */
899
1113
  exportSecretKey(conversationId: ConversationId, keyLength: number): Promise<Uint8Array>;
1114
+ /**
1115
+ * Returns the raw public key of the single external sender present in this group.
1116
+ * This should be used to initialize a subconversation
1117
+ *
1118
+ * @param conversationId - The group's ID
1119
+ *
1120
+ * @returns A `Uint8Array` representing the external sender raw public key
1121
+ */
1122
+ getExternalSender(conversationId: ConversationId): Promise<Uint8Array>;
900
1123
  /**
901
1124
  * Returns all clients from group's members
902
1125
  *
@@ -921,7 +1144,7 @@ export declare class CoreCrypto {
921
1144
  */
922
1145
  reseedRng(seed: Uint8Array): Promise<void>;
923
1146
  /**
924
- * Initiailizes the proteus client
1147
+ * Initializes the proteus client
925
1148
  */
926
1149
  proteusInit(): Promise<void>;
927
1150
  /**
@@ -1054,47 +1277,91 @@ export declare class CoreCrypto {
1054
1277
  * Creates an enrollment instance with private key material you can use in order to fetch
1055
1278
  * a new x509 certificate from the acme server.
1056
1279
  *
1057
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1058
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
1059
- * @param handle user handle e.g. `alice.smith.qa@example.com`
1060
- * @param expiryDays generated x509 certificate expiry
1280
+ * @param clientId - client identifier e.g. `b7ac11a4-8f01-4527-af88-1c30885a7931:6add501bacd1d90e@example.com`
1281
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1282
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
1283
+ * @param expirySec - generated x509 certificate expiry
1061
1284
  * @param ciphersuite - for generating signing key material
1062
- * @returns The new {@link WireE2eIdentity} object
1285
+ * @param team - name of the Wire team a user belongs to
1286
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiMlsInitOnly}
1063
1287
  */
1064
- e2eiNewEnrollment(clientId: string, displayName: string, handle: string, expiryDays: number, ciphersuite: Ciphersuite): Promise<WireE2eIdentity>;
1288
+ e2eiNewEnrollment(clientId: string, displayName: string, handle: string, expirySec: number, ciphersuite: Ciphersuite, team?: string): Promise<E2eiEnrollment>;
1065
1289
  /**
1066
1290
  * Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI.
1067
1291
  * Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
1068
1292
  *
1069
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1070
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
1071
- * @param handle user handle e.g. `alice.smith.qa@example.com`
1072
- * @param expiryDays generated x509 certificate expiry
1293
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1294
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
1295
+ * @param expirySec - generated x509 certificate expiry
1073
1296
  * @param ciphersuite - for generating signing key material
1074
- * @returns The new {@link WireE2eIdentity} object
1297
+ * @param team - name of the Wire team a user belongs to
1298
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiRotateAll}
1075
1299
  */
1076
- e2eiNewActivationEnrollment(clientId: string, displayName: string, handle: string, expiryDays: number, ciphersuite: Ciphersuite): Promise<WireE2eIdentity>;
1300
+ e2eiNewActivationEnrollment(displayName: string, handle: string, expirySec: number, ciphersuite: Ciphersuite, team?: string): Promise<E2eiEnrollment>;
1077
1301
  /**
1078
1302
  * Generates an E2EI enrollment instance for a E2EI client (with a X509 certificate credential)
1079
1303
  * having to change/rotate their credential, either because the former one is expired or it
1080
1304
  * has been revoked. It lets you change the DisplayName or the handle
1081
1305
  * if you need to. Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
1082
1306
  *
1083
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1084
- * @param expiryDays generated x509 certificate expiry
1307
+ * @param expirySec - generated x509 certificate expiry
1085
1308
  * @param ciphersuite - for generating signing key material
1086
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
1087
- * @param handle user handle e.g. `alice.smith.qa@example.com`
1088
- * @returns The new {@link WireE2eIdentity} object
1309
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1310
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
1311
+ * @param team - name of the Wire team a user belongs to
1312
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiRotateAll}
1089
1313
  */
1090
- e2eiNewRotateEnrollment(clientId: string, expiryDays: number, ciphersuite: Ciphersuite, displayName?: string, handle?: string): Promise<WireE2eIdentity>;
1314
+ e2eiNewRotateEnrollment(expirySec: number, ciphersuite: Ciphersuite, displayName?: string, handle?: string, team?: string): Promise<E2eiEnrollment>;
1091
1315
  /**
1092
- * 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
1316
+ * Use this method to initialize end-to-end identity when a client signs up and the grace period is already expired ;
1317
+ * that means he cannot initialize with a Basic credential
1093
1318
  *
1094
1319
  * @param enrollment - the enrollment instance used to fetch the certificates
1095
1320
  * @param certificateChain - the raw response from ACME server
1321
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
1322
+ * @returns a MlsClient initialized with only a x509 credential
1323
+ */
1324
+ e2eiMlsInitOnly(enrollment: E2eiEnrollment, certificateChain: string, nbKeyPackage?: number): Promise<string[] | undefined>;
1325
+ /**
1326
+ * Dumps the PKI environment as PEM
1327
+ *
1328
+ * @returns a struct with different fields representing the PKI environment as PEM strings
1329
+ */
1330
+ e2eiDumpPKIEnv(): Promise<E2eiDumpedPkiEnv | undefined>;
1331
+ /**
1332
+ * @returns whether the E2EI PKI environment is setup (i.e. Root CA, Intermediates, CRLs)
1333
+ */
1334
+ e2eiIsPKIEnvSetup(): Promise<boolean>;
1335
+ /**
1336
+ * Registers a Root Trust Anchor CA for the use in E2EI processing.
1337
+ *
1338
+ * Please note that without a Root Trust Anchor, all validations *will* fail;
1339
+ * So this is the first step to perform after initializing your E2EI client
1340
+ *
1341
+ * @param trustAnchorPEM - PEM certificate to anchor as a Trust Root
1342
+ */
1343
+ e2eiRegisterAcmeCA(trustAnchorPEM: string): Promise<void>;
1344
+ /**
1345
+ * Registers an Intermediate CA for the use in E2EI processing.
1346
+ *
1347
+ * Please note that a Root Trust Anchor CA is needed to validate Intermediate CAs;
1348
+ * You **need** to have a Root CA registered before calling this
1349
+ *
1350
+ * @param certPEM - PEM certificate to register as an Intermediate CA
1096
1351
  */
1097
- e2eiMlsInitOnly(enrollment: WireE2eIdentity, certificateChain: string): Promise<void>;
1352
+ e2eiRegisterIntermediateCA(certPEM: string): Promise<string[] | undefined>;
1353
+ /**
1354
+ * Registers a CRL for the use in E2EI processing.
1355
+ *
1356
+ * Please note that a Root Trust Anchor CA is needed to validate CRLs;
1357
+ * You **need** to have a Root CA registered before calling this
1358
+ *
1359
+ * @param crlDP - CRL Distribution Point; Basically the URL you fetched it from
1360
+ * @param crlDER - DER representation of the CRL
1361
+ *
1362
+ * @returns a {@link CRLRegistration} with the dirty state of the new CRL (see struct) and its expiration timestamp
1363
+ */
1364
+ e2eiRegisterCRL(crlDP: string, crlDER: Uint8Array): Promise<CRLRegistration>;
1098
1365
  /**
1099
1366
  * Creates a commit in all local conversations for changing the credential. Requires first
1100
1367
  * having enrolled a new X509 certificate with either {@link CoreCrypto.e2eiNewActivationEnrollment}
@@ -1103,8 +1370,9 @@ export declare class CoreCrypto {
1103
1370
  * @param enrollment - the enrollment instance used to fetch the certificates
1104
1371
  * @param certificateChain - the raw response from ACME server
1105
1372
  * @param newKeyPackageCount - number of KeyPackages with new identity to generate
1373
+ * @returns a {@link RotateBundle} with commits to fan-out to other group members, KeyPackages to upload and old ones to delete
1106
1374
  */
1107
- e2eiRotateAll(enrollment: WireE2eIdentity, certificateChain: string, newKeyPackageCount: number): Promise<RotateBundle>;
1375
+ e2eiRotateAll(enrollment: E2eiEnrollment, certificateChain: string, newKeyPackageCount: number): Promise<RotateBundle>;
1108
1376
  /**
1109
1377
  * Allows persisting an active enrollment (for example while redirecting the user during OAuth) in order to resume
1110
1378
  * it later with {@link e2eiEnrollmentStashPop}
@@ -1112,16 +1380,16 @@ export declare class CoreCrypto {
1112
1380
  * @param enrollment the enrollment instance to persist
1113
1381
  * @returns a handle to fetch the enrollment later with {@link e2eiEnrollmentStashPop}
1114
1382
  */
1115
- e2eiEnrollmentStash(enrollment: WireE2eIdentity): Promise<Uint8Array>;
1383
+ e2eiEnrollmentStash(enrollment: E2eiEnrollment): Promise<Uint8Array>;
1116
1384
  /**
1117
1385
  * Fetches the persisted enrollment and deletes it from the keystore
1118
1386
  *
1119
1387
  * @param handle returned by {@link e2eiEnrollmentStash}
1120
1388
  * @returns the persisted enrollment instance
1121
1389
  */
1122
- e2eiEnrollmentStashPop(handle: Uint8Array): Promise<WireE2eIdentity>;
1390
+ e2eiEnrollmentStashPop(handle: Uint8Array): Promise<E2eiEnrollment>;
1123
1391
  /**
1124
- * Indicates when to mark a conversation as degraded i.e. when not all its members have a X509.
1392
+ * Indicates when to mark a conversation as not verified i.e. when not all its members have a X509.
1125
1393
  * Credential generated by Wire's end-to-end identity enrollment
1126
1394
  *
1127
1395
  * @param conversationId The group's ID
@@ -1132,9 +1400,37 @@ export declare class CoreCrypto {
1132
1400
  * Returns true when end-to-end-identity is enabled for the given Ciphersuite
1133
1401
  *
1134
1402
  * @param ciphersuite of the credential to check
1135
- * @returns true end-to-end identity is enabled for the given ciphersuite
1403
+ * @returns true if end-to-end identity is enabled for the given ciphersuite
1136
1404
  */
1137
1405
  e2eiIsEnabled(ciphersuite: Ciphersuite): Promise<boolean>;
1406
+ /**
1407
+ * From a given conversation, get the identity of the members supplied. Identity is only present for members with a
1408
+ * Certificate Credential (after turning on end-to-end identity).
1409
+ *
1410
+ * @param conversationId - identifier of the conversation
1411
+ * @param deviceIds - identifiers of the devices
1412
+ * @returns identities or if no member has a x509 certificate, it will return an empty List
1413
+ */
1414
+ getDeviceIdentities(conversationId: ConversationId, deviceIds: ClientId[]): Promise<WireIdentity[]>;
1415
+ /**
1416
+ * From a given conversation, get the identity of the users (device holders) supplied.
1417
+ * Identity is only present for devices with a Certificate Credential (after turning on end-to-end identity).
1418
+ * If no member has a x509 certificate, it will return an empty Vec.
1419
+ *
1420
+ * @param conversationId - identifier of the conversation
1421
+ * @param userIds - user identifiers hyphenated UUIDv4 e.g. 'bd4c7053-1c5a-4020-9559-cd7bf7961954'
1422
+ * @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.
1423
+ */
1424
+ getUserIdentities(conversationId: ConversationId, userIds: string[]): Promise<Map<string, WireIdentity[]>>;
1425
+ /**
1426
+ * Gets the e2ei conversation state from a `GroupInfo`. Useful to check if the group has e2ei
1427
+ * turned on or not before joining it.
1428
+ *
1429
+ * @param groupInfo - a TLS encoded GroupInfo fetched from the Delivery Service
1430
+ * @param credentialType - kind of Credential to check usage of. Defaults to X509 for now as no other value will give any result.
1431
+ * @returns see {@link E2eiConversationState}
1432
+ */
1433
+ getCredentialInUse(groupInfo: Uint8Array, credentialType?: CredentialType): Promise<E2eiConversationState>;
1138
1434
  /**
1139
1435
  * Returns the current version of {@link CoreCrypto}
1140
1436
  *
@@ -1143,7 +1439,7 @@ export declare class CoreCrypto {
1143
1439
  static version(): string;
1144
1440
  }
1145
1441
  type JsonRawData = Uint8Array;
1146
- export declare class WireE2eIdentity {
1442
+ export declare class E2eiEnrollment {
1147
1443
  #private;
1148
1444
  /** @hidden */
1149
1445
  constructor(e2ei: unknown);
@@ -1160,7 +1456,7 @@ export declare class WireE2eIdentity {
1160
1456
  * @param directory HTTP response body
1161
1457
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
1162
1458
  */
1163
- directoryResponse(directory: JsonRawData): AcmeDirectory;
1459
+ directoryResponse(directory: JsonRawData): Promise<AcmeDirectory>;
1164
1460
  /**
1165
1461
  * For creating a new acme account. This returns a signed JWS-alike request body to send to
1166
1462
  * `POST /acme/{provisioner-name}/new-account`.
@@ -1168,27 +1464,27 @@ export declare class WireE2eIdentity {
1168
1464
  * @param previousNonce you got from calling `HEAD {@link AcmeDirectory.newNonce}`
1169
1465
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
1170
1466
  */
1171
- newAccountRequest(previousNonce: string): JsonRawData;
1467
+ newAccountRequest(previousNonce: string): Promise<JsonRawData>;
1172
1468
  /**
1173
1469
  * Parses the response from `POST /acme/{provisioner-name}/new-account`.
1174
1470
  * @param account HTTP response body
1175
1471
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
1176
1472
  */
1177
- newAccountResponse(account: JsonRawData): void;
1473
+ newAccountResponse(account: JsonRawData): Promise<void>;
1178
1474
  /**
1179
1475
  * Creates a new acme order for the handle (userId + display name) and the clientId.
1180
1476
  *
1181
1477
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-account`
1182
1478
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1183
1479
  */
1184
- newOrderRequest(previousNonce: string): JsonRawData;
1480
+ newOrderRequest(previousNonce: string): Promise<JsonRawData>;
1185
1481
  /**
1186
1482
  * Parses the response from `POST /acme/{provisioner-name}/new-order`.
1187
1483
  *
1188
1484
  * @param order HTTP response body
1189
1485
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1190
1486
  */
1191
- newOrderResponse(order: JsonRawData): NewAcmeOrder;
1487
+ newOrderResponse(order: JsonRawData): Promise<NewAcmeOrder>;
1192
1488
  /**
1193
1489
  * Creates a new authorization request.
1194
1490
  *
@@ -1197,14 +1493,14 @@ export declare class WireE2eIdentity {
1197
1493
  * previous to this method if you are creating the second authorization)
1198
1494
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1199
1495
  */
1200
- newAuthzRequest(url: string, previousNonce: string): JsonRawData;
1496
+ newAuthzRequest(url: string, previousNonce: string): Promise<JsonRawData>;
1201
1497
  /**
1202
1498
  * Parses the response from `POST /acme/{provisioner-name}/authz/{authz-id}`
1203
1499
  *
1204
1500
  * @param authz HTTP response body
1205
1501
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1206
1502
  */
1207
- newAuthzResponse(authz: JsonRawData): NewAcmeAuthz;
1503
+ newAuthzResponse(authz: JsonRawData): Promise<NewAcmeAuthz>;
1208
1504
  /**
1209
1505
  * Generates a new client Dpop JWT token. It demonstrates proof of possession of the nonces
1210
1506
  * (from wire-server & acme server) and will be verified by the acme server when verifying the
@@ -1216,7 +1512,7 @@ export declare class WireE2eIdentity {
1216
1512
  * @param expirySecs of the client Dpop JWT. This should be equal to the grace period set in Team Management
1217
1513
  * @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}
1218
1514
  */
1219
- createDpopToken(expirySecs: number, backendNonce: string): Uint8Array;
1515
+ createDpopToken(expirySecs: number, backendNonce: string): Promise<Uint8Array>;
1220
1516
  /**
1221
1517
  * Creates a new challenge request for Wire Dpop challenge.
1222
1518
  *
@@ -1224,7 +1520,14 @@ export declare class WireE2eIdentity {
1224
1520
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
1225
1521
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1226
1522
  */
1227
- newDpopChallengeRequest(accessToken: string, previousNonce: string): JsonRawData;
1523
+ newDpopChallengeRequest(accessToken: string, previousNonce: string): Promise<JsonRawData>;
1524
+ /**
1525
+ * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}` for the DPoP challenge.
1526
+ *
1527
+ * @param challenge HTTP response body
1528
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1529
+ */
1530
+ newDpopChallengeResponse(challenge: JsonRawData): Promise<void>;
1228
1531
  /**
1229
1532
  * Creates a new challenge request for Wire Oidc challenge.
1230
1533
  *
@@ -1232,14 +1535,15 @@ export declare class WireE2eIdentity {
1232
1535
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
1233
1536
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1234
1537
  */
1235
- newOidcChallengeRequest(idToken: string, previousNonce: string): JsonRawData;
1538
+ newOidcChallengeRequest(idToken: string, previousNonce: string): Promise<JsonRawData>;
1236
1539
  /**
1237
- * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}`.
1540
+ * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}` for the OIDC challenge.
1238
1541
  *
1542
+ * @param cc the CoreCrypto instance
1239
1543
  * @param challenge HTTP response body
1240
1544
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1241
1545
  */
1242
- newChallengeResponse(challenge: JsonRawData): void;
1546
+ newOidcChallengeResponse(challenge: JsonRawData): Promise<void>;
1243
1547
  /**
1244
1548
  * Verifies that the previous challenge has been completed.
1245
1549
  *
@@ -1247,22 +1551,22 @@ export declare class WireE2eIdentity {
1247
1551
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
1248
1552
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1249
1553
  */
1250
- checkOrderRequest(orderUrl: string, previousNonce: string): JsonRawData;
1554
+ checkOrderRequest(orderUrl: string, previousNonce: string): Promise<JsonRawData>;
1251
1555
  /**
1252
1556
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}`.
1253
1557
  *
1254
1558
  * @param order HTTP response body
1255
- * @return the finalize url to use with {@link finalizeRequest}
1559
+ * @return finalize url to use with {@link finalizeRequest}
1256
1560
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1257
1561
  */
1258
- checkOrderResponse(order: JsonRawData): string;
1562
+ checkOrderResponse(order: JsonRawData): Promise<string>;
1259
1563
  /**
1260
1564
  * Final step before fetching the certificate.
1261
1565
  *
1262
1566
  * @param previousNonce - `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
1263
1567
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1264
1568
  */
1265
- finalizeRequest(previousNonce: string): JsonRawData;
1569
+ finalizeRequest(previousNonce: string): Promise<JsonRawData>;
1266
1570
  /**
1267
1571
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}/finalize`.
1268
1572
  *
@@ -1270,105 +1574,14 @@ export declare class WireE2eIdentity {
1270
1574
  * @return the certificate url to use with {@link certificateRequest}
1271
1575
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1272
1576
  */
1273
- finalizeResponse(finalize: JsonRawData): string;
1577
+ finalizeResponse(finalize: JsonRawData): Promise<string>;
1274
1578
  /**
1275
1579
  * Creates a request for finally fetching the x509 certificate.
1276
1580
  *
1277
1581
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}/finalize`
1278
1582
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
1279
1583
  */
1280
- certificateRequest(previousNonce: string): JsonRawData;
1281
- }
1282
- /**
1283
- * Holds URLs of all the standard ACME endpoint supported on an ACME server.
1284
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
1285
- */
1286
- export interface AcmeDirectory {
1287
- /**
1288
- * URL for fetching a new nonce. Use this only for creating a new account.
1289
- *
1290
- * @readonly
1291
- */
1292
- newNonce: string;
1293
- /**
1294
- * URL for creating a new account.
1295
- *
1296
- * @readonly
1297
- */
1298
- newAccount: string;
1299
- /**
1300
- * URL for creating a new order.
1301
- *
1302
- * @readonly
1303
- */
1304
- newOrder: string;
1305
- }
1306
- /**
1307
- * Result of an order creation
1308
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1309
- */
1310
- export interface NewAcmeOrder {
1311
- /**
1312
- * Contains raw JSON data of this order. This is parsed by the underlying Rust library hence should not be accessed
1313
- *
1314
- * @readonly
1315
- */
1316
- delegate: Uint8Array;
1317
- /**
1318
- * An authorization for each domain to create
1319
- *
1320
- * @readonly
1321
- */
1322
- authorizations: Uint8Array[];
1323
- }
1324
- /**
1325
- * Result of an authorization creation.
1326
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1327
- */
1328
- export interface NewAcmeAuthz {
1329
- /**
1330
- * DNS entry associated with those challenge
1331
- *
1332
- * @readonly
1333
- */
1334
- identifier: string;
1335
- /**
1336
- * Challenge for the clientId
1337
- *
1338
- * @readonly
1339
- */
1340
- wireDpopChallenge?: AcmeChallenge;
1341
- /**
1342
- * Challenge for the userId and displayName
1343
- *
1344
- * @readonly
1345
- */
1346
- wireOidcChallenge?: AcmeChallenge;
1347
- }
1348
- /**
1349
- * For creating a challenge
1350
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1351
- */
1352
- export interface AcmeChallenge {
1353
- /**
1354
- * Contains raw JSON data of this challenge. This is parsed by the underlying Rust library hence should not be accessed
1355
- *
1356
- * @readonly
1357
- */
1358
- delegate: Uint8Array;
1359
- /**
1360
- * URL of this challenge
1361
- *
1362
- * @readonly
1363
- */
1364
- url: string;
1365
- /**
1366
- * Non-standard, Wire specific claim. Indicates the consumer from where it should get the challenge proof.
1367
- * Either from wire-server "/access-token" endpoint in case of a DPoP challenge, or from an OAuth token endpoint for an OIDC challenge
1368
- *
1369
- * @readonly
1370
- */
1371
- target: string;
1584
+ certificateRequest(previousNonce: string): Promise<JsonRawData>;
1372
1585
  }
1373
1586
  /**
1374
1587
  * Indicates the state of a Conversation regarding end-to-end identity.
@@ -1383,9 +1596,9 @@ export declare enum E2eiConversationState {
1383
1596
  /**
1384
1597
  * Some clients are either still Basic or their certificate is expired
1385
1598
  */
1386
- Degraded = 2,
1599
+ NotVerified = 2,
1387
1600
  /**
1388
- * All clients are still Basic. If all client have expired certificates, Degraded is returned.
1601
+ * All clients are still Basic. If all client have expired certificates, NotVerified is returned.
1389
1602
  */
1390
1603
  NotEnabled = 3
1391
1604
  }