mirror of
https://github.com/bitwarden/ios.git
synced 2026-04-13 01:13:26 -05:00
34 lines
802 B
Swift
34 lines
802 B
Swift
import BitwardenSdk
|
|
import Foundation
|
|
import Networking
|
|
|
|
// MARK: - KeysRequestModel
|
|
|
|
/// A model used to set account keys
|
|
///
|
|
struct KeysRequestModel: Codable, Equatable {
|
|
// MARK: Properties
|
|
|
|
/// The encrypted private key used to set account keys`.
|
|
let encryptedPrivateKey: String
|
|
|
|
/// The public key used to set account keys.
|
|
var publicKey: String?
|
|
}
|
|
|
|
extension KeysRequestModel {
|
|
// MARK: Initialization
|
|
|
|
/// Initialize `KeysRequestModel` from a `RsaKeyPair`.
|
|
///
|
|
/// - Parameter keyPair: The key pair used to initialize a `KeysRequestModel`.
|
|
///
|
|
init(keyPair: RsaKeyPair) {
|
|
self.init(encryptedPrivateKey: keyPair.private, publicKey: keyPair.public)
|
|
}
|
|
}
|
|
|
|
extension KeysRequestModel: JSONRequestBody {
|
|
static let encoder = JSONEncoder()
|
|
}
|