Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Changes to support relative key pats
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijs2704 committed Jan 4, 2017
1 parent caf3ea8 commit a4cdfd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/VaporAPNS/String+APNS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ extension String {

/// Converts the string (which is a path for the auth key) to a token string
func tokenString() throws -> (privateKey: String, publicKey: String) {
guard let authKeyUrl = URL(string: "file://\(self)") else {
guard FileManager.default.fileExists(atPath: self) else {
throw TokenError.invalidAuthKey
}

// Fold p8 file and write it back to the file
let fileString = try String(contentsOf: authKeyUrl, encoding: .utf8)
let fileString = try String.init(contentsOfFile: self, encoding: .utf8)
guard
let privateKeyString =
fileString.collapseWhitespace().trimmingCharacters(in: .whitespaces).between(
Expand Down

0 comments on commit a4cdfd2

Please sign in to comment.