Skip to content
Snippets Groups Projects
Select Git revision
  • 68ff171a7481a865339a420c7f179cbabcc427e9
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

MessengerSendFile.swift

Blame
  • ReceptionIdentity.swift 894 B
    import Foundation
    
    public struct ReceptionIdentity: Equatable {
      public init(
        id: Data,
        rsaPrivatePem: Data,
        salt: Data,
        dhKeyPrivate: Data,
        e2eGrp: Data
      ) {
        self.id = id
        self.rsaPrivatePem = rsaPrivatePem
        self.salt = salt
        self.dhKeyPrivate = dhKeyPrivate
        self.e2eGrp = e2eGrp
      }
    
      public var id: Data
      public var rsaPrivatePem: Data
      public var salt: Data
      public var dhKeyPrivate: Data
      public var e2eGrp: Data
    }
    
    extension ReceptionIdentity: Codable {
      enum CodingKeys: String, CodingKey {
        case id = "ID"
        case rsaPrivatePem = "RSAPrivatePem"
        case salt = "Salt"
        case dhKeyPrivate = "DHKeyPrivate"
        case e2eGrp = "E2eGrp"
      }
    
      public static func decode(_ data: Data) throws -> Self {
        try JSONDecoder().decode(Self.self, from: data)
      }
    
      public func encode() throws -> Data {
        try JSONEncoder().encode(self)
      }
    }