Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svdo/swift-selfsignedcert
A framework for iOS that allows creating self-signed certificates, implemented in Swift.
https://github.com/svdo/swift-selfsignedcert
Last synced: 3 months ago
JSON representation
A framework for iOS that allows creating self-signed certificates, implemented in Swift.
- Host: GitHub
- URL: https://github.com/svdo/swift-selfsignedcert
- Owner: svdo
- License: mit
- Created: 2016-07-13T12:55:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-19T07:16:11.000Z (about 2 years ago)
- Last Synced: 2024-10-03T16:17:07.941Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 486 KB
- Stars: 42
- Watchers: 8
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE.txt
Awesome Lists containing this project
README
# SelfSignedCert
![Swift Version 5](https://img.shields.io/badge/Swift-v5-yellow.svg)
[![CocoaPods Version Badge](https://img.shields.io/cocoapods/v/SelfSignedCert.svg)](https://cocoapods.org/pods/SelfSignedCert)
[![License Badge](https://img.shields.io/cocoapods/l/SelfSignedCert.svg)](LICENSE.txt)
![Supported Platforms Badge](https://img.shields.io/cocoapods/p/SelfSignedCert.svg)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)This project provides a Swift framework that allows you to create self-signed
certificates on iOS, using Swift. Unfortunately, Apple does not provide this
functionality in their security frameworks. Another way of doing it is using
OpenSSL, but (especially when using Swift) that is downright horrible.The code in this library is a (partial) port of
[MYCrypto](https://github.com/snej/MYCrypto). That project contains unmaintained
Objective-C code, which was difficult to use as a CocoaPod and especially also
when using Swift. So I took that part that I needed and implemented that in
Swift.Please note that I'm not a security expert. This framework has not been reviewed
by a security expert. Until it has, please use with caution! And in any case
(reviewed or not), using it is always at your own risk of course.If you are a security expert and you want to review this framework, please
contact me.## Usage
```swift
guard let identity = SecIdentity.create(
subjectCommonName: "common name",
subjectEmailAddress: "[email protected]") else {
return
}```
This will give you a self-signed `SecIdentity?` that is already stored in the
keychain. See also [SecIdentity+SelfSigned.swift][1] for functions to retrieve
previously created identities from the keychain.## Related Library
You may want to have a look at [swift-SecurityExtensions][2] for some helpers
to more easily use `SecIdentity`, `SecCertificate`, and `SecKey`.[1]: https://github.com/svdo/swift-SelfSignedCert/blob/master/SelfSignedCert/SecIdentity%2BSelfSigned.swift
[2]: https://github.com/svdo/swift-SecurityExtensions