@@ -703,6 +703,85 @@ public func FfiConverterTypeClientSettings_lower(_ value: ClientSettings) -> Rus
703
703
}
704
704
705
705
706
+ public struct DeriveKeyConnectorRequest {
707
+ /**
708
+ * Encrypted user key, used to validate the master key
709
+ */
710
+ public let userKeyEncrypted : EncString
711
+ public let password : String
712
+ public let kdf : Kdf
713
+ public let email : String
714
+
715
+ // Default memberwise initializers are never public by default, so we
716
+ // declare one manually.
717
+ public init (
718
+ /**
719
+ * Encrypted user key, used to validate the master key
720
+ */userKeyEncrypted: EncString , password: String , kdf: Kdf , email: String ) {
721
+ self . userKeyEncrypted = userKeyEncrypted
722
+ self . password = password
723
+ self . kdf = kdf
724
+ self . email = email
725
+ }
726
+ }
727
+
728
+
729
+
730
+ extension DeriveKeyConnectorRequest : Equatable , Hashable {
731
+ public static func == ( lhs: DeriveKeyConnectorRequest , rhs: DeriveKeyConnectorRequest ) -> Bool {
732
+ if lhs. userKeyEncrypted != rhs. userKeyEncrypted {
733
+ return false
734
+ }
735
+ if lhs. password != rhs. password {
736
+ return false
737
+ }
738
+ if lhs. kdf != rhs. kdf {
739
+ return false
740
+ }
741
+ if lhs. email != rhs. email {
742
+ return false
743
+ }
744
+ return true
745
+ }
746
+
747
+ public func hash( into hasher: inout Hasher ) {
748
+ hasher. combine ( userKeyEncrypted)
749
+ hasher. combine ( password)
750
+ hasher. combine ( kdf)
751
+ hasher. combine ( email)
752
+ }
753
+ }
754
+
755
+
756
+ public struct FfiConverterTypeDeriveKeyConnectorRequest : FfiConverterRustBuffer {
757
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> DeriveKeyConnectorRequest {
758
+ return
759
+ try DeriveKeyConnectorRequest (
760
+ userKeyEncrypted: FfiConverterTypeEncString . read ( from: & buf) ,
761
+ password: FfiConverterString . read ( from: & buf) ,
762
+ kdf: FfiConverterTypeKdf . read ( from: & buf) ,
763
+ email: FfiConverterString . read ( from: & buf)
764
+ )
765
+ }
766
+
767
+ public static func write( _ value: DeriveKeyConnectorRequest , into buf: inout [ UInt8 ] ) {
768
+ FfiConverterTypeEncString . write ( value. userKeyEncrypted, into: & buf)
769
+ FfiConverterString . write ( value. password, into: & buf)
770
+ FfiConverterTypeKdf . write ( value. kdf, into: & buf)
771
+ FfiConverterString . write ( value. email, into: & buf)
772
+ }
773
+ }
774
+
775
+
776
+ public func FfiConverterTypeDeriveKeyConnectorRequest_lift( _ buf: RustBuffer ) throws -> DeriveKeyConnectorRequest {
777
+ return try FfiConverterTypeDeriveKeyConnectorRequest . lift ( buf)
778
+ }
779
+
780
+ public func FfiConverterTypeDeriveKeyConnectorRequest_lower( _ value: DeriveKeyConnectorRequest ) -> RustBuffer {
781
+ return FfiConverterTypeDeriveKeyConnectorRequest . lower ( value)
782
+ }
783
+
784
+
706
785
public struct DerivePinKeyResponse {
707
786
/**
708
787
* [UserKey](bitwarden_crypto::UserKey) protected by PIN
@@ -993,6 +1072,71 @@ public func FfiConverterTypeInitUserCryptoRequest_lower(_ value: InitUserCryptoR
993
1072
}
994
1073
995
1074
1075
+ public struct KeyConnectorResponse {
1076
+ public let masterKey : String
1077
+ public let encryptedUserKey : String
1078
+ public let keys : RsaKeyPair
1079
+
1080
+ // Default memberwise initializers are never public by default, so we
1081
+ // declare one manually.
1082
+ public init ( masterKey: String , encryptedUserKey: String , keys: RsaKeyPair ) {
1083
+ self . masterKey = masterKey
1084
+ self . encryptedUserKey = encryptedUserKey
1085
+ self . keys = keys
1086
+ }
1087
+ }
1088
+
1089
+
1090
+
1091
+ extension KeyConnectorResponse : Equatable , Hashable {
1092
+ public static func == ( lhs: KeyConnectorResponse , rhs: KeyConnectorResponse ) -> Bool {
1093
+ if lhs. masterKey != rhs. masterKey {
1094
+ return false
1095
+ }
1096
+ if lhs. encryptedUserKey != rhs. encryptedUserKey {
1097
+ return false
1098
+ }
1099
+ if lhs. keys != rhs. keys {
1100
+ return false
1101
+ }
1102
+ return true
1103
+ }
1104
+
1105
+ public func hash( into hasher: inout Hasher ) {
1106
+ hasher. combine ( masterKey)
1107
+ hasher. combine ( encryptedUserKey)
1108
+ hasher. combine ( keys)
1109
+ }
1110
+ }
1111
+
1112
+
1113
+ public struct FfiConverterTypeKeyConnectorResponse : FfiConverterRustBuffer {
1114
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> KeyConnectorResponse {
1115
+ return
1116
+ try KeyConnectorResponse (
1117
+ masterKey: FfiConverterString . read ( from: & buf) ,
1118
+ encryptedUserKey: FfiConverterString . read ( from: & buf) ,
1119
+ keys: FfiConverterTypeRsaKeyPair . read ( from: & buf)
1120
+ )
1121
+ }
1122
+
1123
+ public static func write( _ value: KeyConnectorResponse , into buf: inout [ UInt8 ] ) {
1124
+ FfiConverterString . write ( value. masterKey, into: & buf)
1125
+ FfiConverterString . write ( value. encryptedUserKey, into: & buf)
1126
+ FfiConverterTypeRsaKeyPair . write ( value. keys, into: & buf)
1127
+ }
1128
+ }
1129
+
1130
+
1131
+ public func FfiConverterTypeKeyConnectorResponse_lift( _ buf: RustBuffer ) throws -> KeyConnectorResponse {
1132
+ return try FfiConverterTypeKeyConnectorResponse . lift ( buf)
1133
+ }
1134
+
1135
+ public func FfiConverterTypeKeyConnectorResponse_lower( _ value: KeyConnectorResponse ) -> RustBuffer {
1136
+ return FfiConverterTypeKeyConnectorResponse . lower ( value)
1137
+ }
1138
+
1139
+
996
1140
public struct MasterPasswordPolicyOptions {
997
1141
public let minComplexity : UInt8
998
1142
public let minLength : UInt8
@@ -1672,6 +1816,14 @@ public enum InitUserCryptoMethod {
1672
1816
* The user's symmetric crypto key, encrypted with the Device Key.
1673
1817
*/deviceProtectedUserKey: AsymmetricEncString
1674
1818
)
1819
+ case keyConnector(
1820
+ /**
1821
+ * Base64 encoded master key, retrieved from the key connector.
1822
+ */masterKey: String ,
1823
+ /**
1824
+ * The user's encrypted symmetric crypto key
1825
+ */userKey: String
1826
+ )
1675
1827
}
1676
1828
1677
1829
@@ -1697,6 +1849,9 @@ public struct FfiConverterTypeInitUserCryptoMethod: FfiConverterRustBuffer {
1697
1849
case 5 : return . deviceKey( deviceKey: try FfiConverterString . read ( from: & buf) , protectedDevicePrivateKey: try FfiConverterTypeEncString . read ( from: & buf) , deviceProtectedUserKey: try FfiConverterTypeAsymmetricEncString . read ( from: & buf)
1698
1850
)
1699
1851
1852
+ case 6 : return . keyConnector( masterKey: try FfiConverterString . read ( from: & buf) , userKey: try FfiConverterString . read ( from: & buf)
1853
+ )
1854
+
1700
1855
default : throw UniffiInternalError . unexpectedEnumCase
1701
1856
}
1702
1857
}
@@ -1734,6 +1889,12 @@ public struct FfiConverterTypeInitUserCryptoMethod: FfiConverterRustBuffer {
1734
1889
FfiConverterTypeEncString . write ( protectedDevicePrivateKey, into: & buf)
1735
1890
FfiConverterTypeAsymmetricEncString . write ( deviceProtectedUserKey, into: & buf)
1736
1891
1892
+
1893
+ case let . keyConnector( masterKey, userKey) :
1894
+ writeInt ( & buf, Int32 ( 6 ) )
1895
+ FfiConverterString . write ( masterKey, into: & buf)
1896
+ FfiConverterString . write ( userKey, into: & buf)
1897
+
1737
1898
}
1738
1899
}
1739
1900
}
0 commit comments