Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Swift-Security

Package for typed access to Security (Keychain) services. I built this over the weekend to check how hard it would be to block root certificates, using Swift.

When included as a framework, import it as any other framework:

import Swift_Security

To list all installed root certificates:

let certificates = root_certs()
println(certificates)

Some basic info can be listed about the certificate as well:

certificates[0].commonName
certificates[0].subjectCountry

Check the trust settings for a certificate.

let nl = first(certificates.filter { $0.subjectCountry == "NL" })
println(nl?.commonName)
println(nl?.trustSettings(.Admin))

Change the trust setting for a certificate. This doesn't work in a playground, as a UI dialog for confirming this action will be spawned by OS X.

if var trust = nl?.trustSettings(.Admin) {
    trust[.AppleSSL] = .Deny
    println(trust.save())
}

About

Proof of concept for accessing Keychain using Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published