Skip to content

Commit

Permalink
Add support for DeveloperCertificates
Browse files Browse the repository at this point in the history
  • Loading branch information
James Sherlock committed May 13, 2018
1 parent 02068bd commit 1618f3f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Sources/SwiftyProvisioningProfile/Model/DeveloperCertificate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// DeveloperCertificate.swift
// SwiftyProvisioningProfile
//
// Created by Sherlock, James on 13/05/2018.
//

import Foundation

public struct DeveloperCertificate: Codable, Equatable {

public let data: Data

// MARK: - Codable

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
data = try container.decode(Data.self)
}

public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(data)
}

// MARK: - Convenience

public var base64Encoded: String {
return data.base64EncodedString()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public struct ProvisioningProfile: Codable {
case applicationIdentifierPrefixs = "ApplicationIdentifierPrefix"
case creationDate = "CreationDate"
case platforms = "Platform"
case developerCertificates = "DeveloperCertificates"
case expirationDate = "ExpirationDate"
case name = "Name"
case provisionedDevices = "ProvisionedDevices"
Expand All @@ -34,6 +35,9 @@ public struct ProvisioningProfile: Codable {
/// The platforms in which this profile is compatible with
public var platforms: [String]

/// The array of Base64 encoded developer certificates
public var developerCertificates: [DeveloperCertificate]

/// The date in which this profile will expire
public var expirationDate: Date

Expand Down

0 comments on commit 1618f3f

Please sign in to comment.