AlamofireExtension
public struct AlamofireExtension<ExtendedType>
Type that acts as a generic extension point for all AlamofireExtended types.
-
Returns all valid
cer,crt, anddercertificates in the bundle.Declaration
Swift
var certificates: [SecCertificate] { get } -
Returns all public keys for the valid certificates in the bundle.
Declaration
Swift
var publicKeys: [SecKey] { get } -
Returns all pathnames for the resources identified by the provided file extensions.
Declaration
Swift
func paths(forResourcesOfTypes types: [String]) -> [String]Parameters
typesThe filename extensions locate.
Return Value
All pathnames for the given filename extensions.
-
Attempts to validate
selfusing the policy provided and transforming any error produced using the closure passed.Throws
Any error from applying thepolicy, or the result oferrorProducerif validation fails.Declaration
Swift
func validate(policy: SecPolicy, errorProducer: (_ status: OSStatus, _ result: SecTrustResultType) -> Error) throwsParameters
policyThe
SecPolicyused to evaluateself.errorProducerThe closure used transform the failed
OSStatusandSecTrustResultType. -
Applies a
SecPolicytoself, throwing if it fails.Throws
AnAFError.serverTrustEvaluationFailedinstance with a.policyApplicationFailedreason.Declaration
Swift
func apply(policy: SecPolicy) throws -> SecTrustParameters
policyThe
SecPolicy.Return Value
self, with the policy applied. -
Validate
self, passing any failure values througherrorProducer.Throws
TheErrorproduced by theerrorProducerclosure.Declaration
Swift
func validate(errorProducer: (_ status: OSStatus, _ result: SecTrustResultType) -> Error) throwsParameters
errorProducerThe closure used to transform the failed
OSStatusandSecTrustResultTypeinto anError. -
Sets a custom certificate chain on
self, allowing full validation of a self-signed certificate and its chain.Throws
Any error produced when applying the new certificate chain.Declaration
Swift
func setAnchorCertificates(_ certificates: [SecCertificate]) throwsParameters
certificatesThe
SecCertificates to add to the chain. -
The public keys contained in
self.Declaration
Swift
var publicKeys: [SecKey] { get } -
The
SecCertificates contained iself.Declaration
Swift
var certificates: [SecCertificate] { get } -
The
Datavalues for all certificates contained inself.Declaration
Swift
var certificateData: [Data] { get } -
Validates
selfafter applyingSecPolicy.af.default. This evaluation does not validate the hostname.Throws
AnAFError.serverTrustEvaluationFailedinstance with a.defaultEvaluationFailedreason.Declaration
Swift
func performDefaultValidation(forHost host: String) throwsParameters
hostThe hostname, used only in the error output if validation fails.
-
Validates
selfafter applyingSecPolicy.af.hostname(host), which performs the default validation as well as hostname validation.Throws
AnAFError.serverTrustEvaluationFailedinstance with a.defaultEvaluationFailedreason.Declaration
Swift
func performValidation(forHost host: String) throwsParameters
hostThe hostname to use in the validation.
-
Creates a
SecPolicyinstance which will validate server certificates but not require a host name match.Declaration
Swift
static let `default`: SecPolicy -
Creates a
SecPolicyinstance which will validate server certificates and much match the provided hostname.Declaration
Swift
static func hostname(_ hostname: String) -> SecPolicyParameters
hostnameThe hostname to validate against.
Return Value
The
SecPolicy. -
Creates a
SecPolicywhich checks the revocation of certificates.Throws
AnAFError.serverTrustEvaluationFailederror with reason.revocationPolicyCreationFailedif the policy cannot be created.Declaration
Swift
static func revocation(options: RevocationTrustEvaluator.Options) throws -> SecPolicyParameters
optionsThe
RevocationTrustEvaluator.Optionsfor evaluation.Return Value
The
SecPolicy.
-
All
Datavalues for the containedSecCertificates.Declaration
Swift
var data: [Data] { get } -
All public
SecKeyvalues for the containedSecCertificates.Declaration
Swift
var publicKeys: [SecKey] { get }
-
The public key for
self, if it can be extracted.Declaration
Swift
var publicKey: SecKey? { get }
-
Returns whether
selfiserrSecSuccess.Declaration
Swift
var isSuccess: Bool { get }
-
Returns whether
self is.unspecifiedor.proceed`.Declaration
Swift
var isSuccess: Bool { get }
-
Undocumented
Declaration
Swift
public static var `default`: URLSessionConfiguration { get }
View on GitHub
Install in Dash
AlamofireExtension Structure Reference