File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
crypto-ffi/bindings/jvm/src
main/kotlin/com/wire/crypto
test/kotlin/com/wire/crypto Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,10 @@ fun ByteArray.toAvsSecret() = SecretKey(this)
32
32
33
33
/* * Construct a GroupInfo from bytes */
34
34
fun ByteArray.toGroupInfo () = GroupInfo (this )
35
+
36
+ /* * Construct a new Credential from ciphersuite and client id */
37
+ @Throws(CoreCryptoException ::class )
38
+ fun Credential.Companion.basic (
39
+ ciphersuite : Ciphersuite ,
40
+ clientId : ClientId
41
+ ): Credential = credentialBasic(ciphersuite, clientId)
Original file line number Diff line number Diff line change @@ -475,4 +475,14 @@ class MLSTest : HasMockDeliveryService() {
475
475
)
476
476
}
477
477
}
478
+
479
+ @Test
480
+ fun can_construct_basic_credential (): TestResult {
481
+ val scope = TestScope ()
482
+ return scope.runTest {
483
+ val credential = Credential .basic(CIPHERSUITE_DEFAULT , genClientId())
484
+ assertEquals(credential.type(), CredentialType .BASIC )
485
+ assertEquals<ULong >(credential.earliestValidity(), 0u )
486
+ }
487
+ }
478
488
}
You can’t perform that action at this time.
0 commit comments