SSLSecurity

open class SSLSecurity : SSLTrustValidator

Undocumented

  • Undocumented

    Declaration

    Swift

    public var validatedDN: Bool
  • Undocumented

    Declaration

    Swift

    public var validateEntireChain: Bool
  • Use certs from main app bundle

    Declaration

    Swift

    public convenience init(usePublicKeys: Bool = false)

    Parameters

    usePublicKeys

    is to specific if the publicKeys or certificates should be used for SSL pinning validation

    Return Value

    a representation security object to be used with

  • Designated init

    Declaration

    Swift

    public init(certs: [SSLCert], usePublicKeys: Bool)

    Parameters

    certs

    is the certificates or public keys to use

    usePublicKeys

    is to specific if the publicKeys or certificates should be used for SSL pinning validation

    Return Value

    a representation security object to be used with

  • Valid the trust and domain name.

    Declaration

    Swift

    open func isValid(_ trust: SecTrust, domain: String?) -> Bool

    Parameters

    trust

    is the serverTrust to validate

    domain

    is the CN domain to validate

    Return Value

    if the key was successfully validated

  • Get the public key from a certificate data

    Declaration

    Swift

    public func extractPublicKey(_ data: Data) -> SecKey?

    Parameters

    data

    is the certificate to pull the public key from

    Return Value

    a public key

  • Get the public key from a certificate

    Declaration

    Swift

    public func extractPublicKey(_ cert: SecCertificate, policy: SecPolicy) -> SecKey?

    Parameters

    data

    is the certificate to pull the public key from

    Return Value

    a public key

  • Get the certificate chain for the trust

    Declaration

    Swift

    public func certificateChain(_ trust: SecTrust) -> [Data]

    Parameters

    trust

    is the trust to lookup the certificate chain for

    Return Value

    the certificate chain for the trust

  • Get the public key chain for the trust

    Declaration

    Swift

    public func publicKeyChain(_ trust: SecTrust) -> [SecKey]

    Parameters

    trust

    is the trust to lookup the certificate chain and extract the public keys

    Return Value

    the public keys from the certifcate chain for the trust