Skip to content

Commit

Permalink
Prepare 2.1.0 (#217)
Browse files Browse the repository at this point in the history
* Update readme

* Bump version

* Update changelog

* Update changelog

* Change changelog wording
  • Loading branch information
Daniel authored Feb 24, 2020
1 parent be9a532 commit 5db331d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 28 deletions.
27 changes: 11 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
[PSPDFKit's Changelog Format](https://pspdfkit.com/blog/2018/the-challenges-of-changelogs/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

If applicable, start each entry with one of the following keywords:

- *API*: For highlighting breaking API changes that require people to change their implementations
- *Adds*: For listing new features
- *Fixes*: For listing bugfixes
- *Changes*: For listing improvements and other changes
- *Deprecates*: For listing API deprecations
- *Security*: For highlighting changes related to security vulnerabilities

Include references to issue- or pull-request numbers.
Use active language and present tense.
For convenience, please track any of your changes in the *Unreleased* section
so they can be moved to a respective version upon release.
Please track any of your changes in the *Unreleased* section so they can be moved to a respective version upon release.

## Unreleased

Add your changes here.

## [2.1.0] - 2020-02-24

- Deprecated old encrypter and decrypter APIs ([#216](https://github.com/airsidemobile/JOSESwift/pull/216)) via [@daniel-mohemian](https://github.com/daniel-mohemian)
- Added A128KW, A192KW, and A256KW algorithms ([#211](https://github.com/airsidemobile/JOSESwift/pull/211)) via [@mtamu](https://github.com/mtamu)
- Changed internal JWE encryption and decryption flows ([#210](https://github.com/airsidemobile/JOSESwift/pull/210)) via [@daniel-mohemian](https://github.com/daniel-mohemian)
- Changed CI to CircleCI ([#205](https://github.com/airsidemobile/JOSESwift/pull/205)) via [@haeser](https://github.com/haeser)
- Dried up signing roundtrip tests ([#198](https://github.com/airsidemobile/JOSESwift/pull/198)) via [@daniel-mohemian](https://github.com/daniel-mohemian)
- Added full Sonarqube analysis to pull requests ([#201](https://github.com/airsidemobile/JOSESwift/pull/201)) via [@daniel-mohemian](https://github.com/daniel-mohemian)
- Updated Sonarqube lane to work with the Xcode 11 coverage report format ([#193](https://github.com/airsidemobile/JOSESwift/pull/193)) via [@daniel-mohemian](https://github.com/daniel-mohemian)

## [2.0.0] - 2019-11-20

- Fixes copyright update in prepare lane ([(#191)](https://github.com/airsidemobile/JOSESwift/pull/191)) via [@daniel-mohemian](https://github.com/daniel-mohemian)
Expand Down
2 changes: 1 addition & 1 deletion JOSESwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JOSESwift"
s.version = "2.0.0"
s.version = "2.1.0"
s.license = "Apache License, Version 2.0"
s.summary = "JOSE framework for Swift"
s.authors = { "Daniel Egger" => "[email protected]", "Carol Capek" => "[email protected]", "Christoph Gigi Fuchs" => "[email protected]" }
Expand Down
2 changes: 1 addition & 1 deletion JOSESwift/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<br>

**JOSESwift** is a modular and extensible framework for the [JOSE](https://datatracker.ietf.org/wg/jose/about/) standards [**JWS**](https://tools.ietf.org/html/rfc7515), [**JWE**](https://tools.ietf.org/html/rfc7516), and [**JWK**](https://tools.ietf.org/html/rfc7517) written in Swift.
**JOSESwift** is a modular and extensible framework for the [JOSE](https://datatracker.ietf.org/wg/jose/about/) standards [**JWS**](https://tools.ietf.org/html/rfc7515), [**JWE**](https://tools.ietf.org/html/rfc7516), and [**JWK**](https://tools.ietf.org/html/rfc7517) written in Swift.
As of now, its usage is limited to iOS because it relies on the iOS cryptography frameworks.

[![CircleCI](https://circleci.com/gh/airsidemobile/JOSESwift/tree/master.svg?style=svg)](https://circleci.com/gh/airsidemobile/JOSESwift/tree/master)
Expand Down Expand Up @@ -73,8 +73,8 @@ If you are missing a specific feature, algorithm, or serialization, feel free to

For interchangeability JOSESwift currently supports compact serialization [for JWS](https://tools.ietf.org/html/rfc7515#section-3.1) and [for JWE](https://tools.ietf.org/html/rfc7516#section-3.1).

| Compact Serialization | JSON Serialization |
| :-------------------: | :----------------: |
| Compact Serialization | JSON Serialization |
| :-------------------: | :----------------: |
| :white_check_mark: | |

### Compression Algorithms
Expand Down Expand Up @@ -177,7 +177,7 @@ The JWS compact serialization is a URL-safe string that can easily be transmitte
guard let jws = try? JWS(header: header, payload: payload, signer: signer) else { ... }

print(jws.compactSerializedString) // ey (...) J9.U3 (...) LU.na (...) 1A
```
```

More details about constructing a JWS can be found [in the wiki](../../wiki/jws).

Expand Down Expand Up @@ -219,7 +219,7 @@ In order to construct a JWE we need to provide the following parts:
##### Header

``` swift
let header = JWEHeader(algorithm: .RSA1_5, encryptionAlgorithm: .A256CBCHS512)
let header = JWEHeader(keyManagementAlgorithm: .RSA1_5, contentEncryptionAlgorithm: .A256CBCHS512)
```

Optionally you can set [addtitional parameters](https://tools.ietf.org/html/rfc7516#section-4.1):
Expand All @@ -245,9 +245,21 @@ The encrypter algorithms must match the header algorithms.
``` swift
let publicKey: SecKey = /* ... */

let encrypter = Encrypter(keyEncryptionAlgorithm: .RSA1_5, encryptionKey: publicKey, contentEncyptionAlgorithm: .A256CBCHS512)!
let encrypter = Encrypter(keyManagementAlgorithm: .RSA1_5, contentEncryptionAlgorithm: .A256CBCHS512, encryptionKey: publicKey)!
```

Note that the type of the provided encryption key must match the specified key management algorithm as shown in the following table.

| Key Management Algorithm | Encryption Key Type |
|:-------------------------|:--------------------|
| RSA1_5 | `SecKey` |
| RSAOAEP | `SecKey` |
| RSAOAEP256 | `SecKey` |
| A128KW | `Data` |
| A192KW | `Data` |
| A256KW | `Data` |
| direct | `Data` |

##### Serialization

The JWE compact serialization is a URL-safe string that can easily be transmitted to a third party using a method of your choice.
Expand All @@ -256,7 +268,7 @@ The JWE compact serialization is a URL-safe string that can easily be transmitte
guard let jwe = try? JWE(header: header, payload: payload, encrypter: encrypter) else { ... }

print(jwe.compactSerializedString) // ey (..) n0.HK (..) pQ.yS (..) PA.AK (..) Jx.hB (..) 7w
```
```

More details about constructing a JWE can be found [in the wiki](../../wiki/jwe).

Expand All @@ -271,7 +283,7 @@ let serialization = "ey (..) n0.HK (..) pQ.yS (..) PA.AK (..) Jx.hB (..) 7w"
``` swift
do {
let jwe = try JWE(compactSerialization: serialization)
let decrypter = Decrypter(keyDecryptionAlgorithm: .RSA1_5, decryptionKey: privateKey, contentDecryptionAlgorithm: .A256CBCHS512)!
let decrypter = Decrypter(keyManagementAlgorithm: .RSA1_5, contentEncryptionAlgorithm: .A256CBCHS512, decryptionKey: privateKey)!
let payload = try jwe.decrypt(using: decrypter)
let message = String(data: payload.data(), encoding: .utf8)!

Expand All @@ -281,6 +293,18 @@ do {

More details about decrypting an existing, serialized JWE can be found [in the wiki](../../wiki/jwe).

Note that the type of the provided decryption key must match the specified key management algorithm as shown in the following table.

| Key Management Algorithm | Decryption Key Type |
|:-------------------------|:--------------------|
| RSA1_5 | `SecKey` |
| RSAOAEP | `SecKey` |
| RSAOAEP256 | `SecKey` |
| A128KW | `Data` |
| A192KW | `Data` |
| A256KW | `Data` |
| direct | `Data` |

****

### JWK: Representing Keys
Expand Down Expand Up @@ -325,7 +349,7 @@ See our [security policy](SECURITY.md) for more information.

Contributions to the project are encouraged and more than welcome. :nerd_face:

If you want to contribute, please submit a pull request.
If you want to contribute, please submit a pull request.
For feature requests, discussions, or bug reports, just open an issue.

See our [contributing guidelines](.github/CONTRIBUTING.md) for more information.
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down

0 comments on commit 5db331d

Please sign in to comment.