-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for DeveloperCertificates
- Loading branch information
James Sherlock
committed
May 13, 2018
1 parent
02068bd
commit 1618f3f
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
Sources/SwiftyProvisioningProfile/Model/DeveloperCertificate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters