1*fb441a64SWill Schurman // Copyright 2015-present 650 Industries. All rights reserved. 2*fb441a64SWill Schurman 3*fb441a64SWill Schurman import Foundation 4*fb441a64SWill Schurman 5*fb441a64SWill Schurman enum CodeSigningAlgorithm: String { 6*fb441a64SWill Schurman case RSA_SHA256 = "rsa-v1_5-sha256" 7*fb441a64SWill Schurman parseFromStringnull8*fb441a64SWill Schurman internal static func parseFromString(_ str: String?) throws -> CodeSigningAlgorithm { 9*fb441a64SWill Schurman guard let str = str else { 10*fb441a64SWill Schurman return CodeSigningAlgorithm.RSA_SHA256 11*fb441a64SWill Schurman } 12*fb441a64SWill Schurman 13*fb441a64SWill Schurman guard let alg = CodeSigningAlgorithm(rawValue: str) else { 14*fb441a64SWill Schurman throw CodeSigningError.AlgorithmParseError 15*fb441a64SWill Schurman } 16*fb441a64SWill Schurman 17*fb441a64SWill Schurman return alg 18*fb441a64SWill Schurman } 19*fb441a64SWill Schurman } 20