passforios/passKit/Helpers/CryptographicKeys.swift

37 lines
772 B
Swift
Raw Normal View History

//
2019-07-02 20:20:56 +02:00
// CryptographicKeys.swift
// passKit
//
// Created by Danny Moesch on 29.06.19.
// Copyright © 2019 Bob Sun. All rights reserved.
//
2019-07-02 20:20:56 +02:00
public protocol CryptographicKey {
func getKeychainKey() -> String
func getFileSharingPath() -> String
}
public enum PgpKey: CryptographicKey {
case PUBLIC
case PRIVATE
public func getKeychainKey() -> String {
switch self {
case .PUBLIC:
return "pgpPublicKey"
case .PRIVATE:
return "pgpPrivateKey"
}
}
2019-07-02 20:20:56 +02:00
public func getFileSharingPath() -> String {
switch self {
case .PUBLIC:
return Globals.iTunesFileSharingPGPPublic
case .PRIVATE:
return Globals.iTunesFileSharingPGPPrivate
}
}
}
2019-07-02 20:20:56 +02:00