# \#cryptokit

**URL:** https://forums.swift.org/tag/cryptokit/275.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [How can I get the public key from SecCertificate? And a few other things](https://forums.swift.org/t/how-can-i-get-the-public-key-from-seccertificate-and-a-few-other-things/71330)

<div class="topic-metadata">

**Author:** [@mrtksn](https://forums.swift.org/u/mrtksn)\
**Replies:** 4\
**Last updated:** [April 24, 2024, 8:11am UTC](https://forums.swift.org/t/how-can-i-get-the-public-key-from-seccertificate-and-a-few-other-things/71330 "2024-04-24T08:11:10Z")

</div>

Hi, I'm trying to achieve the following OpenSSL workflow in Swift. I have this intermediate certificate from Let's encrypt and I want to extract the public key from it and then hash it with SHA-256 and finally encide it…

---

## [\[Request for Feedback\] API design of "K1"](https://forums.swift.org/t/request-for-feedback-api-design-of-k1/64027)

<div class="topic-metadata">

**Author:** [@Sajjon](https://forums.swift.org/u/Sajjon)\
**Replies:** 7\
**Last updated:** [April 1, 2023, 8:13am UTC](https://forums.swift.org/t/request-for-feedback-api-design-of-k1/64027 "2023-04-01T08:13:40Z")

</div>

I've created and I maintain a Swift library called K1, offering Elliptic Curve Cryptography over the curve secp256k1 with API's that are heavily inspired by CryptoKit. K1 vendors two fundamentally different signature sc…

---

## [CryptoKit: Custom hash algorithm conforming to HashFunction & Digest](https://forums.swift.org/t/cryptokit-custom-hash-algorithm-conforming-to-hashfunction-digest/63529)

<div class="topic-metadata">

**Author:** [@flocked](https://forums.swift.org/u/flocked)\
**Replies:** 0\
**Last updated:** [March 4, 2023, 7:17pm UTC](https://forums.swift.org/t/cryptokit-custom-hash-algorithm-conforming-to-hashfunction-digest/63529 "2023-03-04T19:17:24Z")

</div>

I try creating a custom hash algorithm that conforms to the HashFunction & Digest protocol of CryptoKit. The algorithm is an implementation of the OpenSubtitles hash which takes the first and last 8 bytes of a data to ge…

---

## [Anyone working with Arweave ecosystem good with both Swift and Encryption?](https://forums.swift.org/t/anyone-working-with-arweave-ecosystem-good-with-both-swift-and-encryption/54229)

<div class="topic-metadata">

**Author:** [@jsoneaday](https://forums.swift.org/u/jsoneaday)\
**Replies:** 0\
**Last updated:** [December 22, 2021, 9:36pm UTC](https://forums.swift.org/t/anyone-working-with-arweave-ecosystem-good-with-both-swift-and-encryption/54229 "2021-12-22T21:36:47Z")

</div>

Working on fixing the arweave-swift api but hung up on what I believe is my last issue: generating transaction signatures. Anyone good with hashing functions and the like?

---

## [Apple CryptoKit API](https://forums.swift.org/t/apple-cryptokit-api/54049)

<div class="topic-metadata">

**Author:** [@jzi](https://forums.swift.org/u/jzi)\
**Replies:** 3\
**Last updated:** [December 15, 2021, 5:04am UTC](https://forums.swift.org/t/apple-cryptokit-api/54049 "2021-12-15T05:04:38Z")

</div>

I have recently been digging into the API of Apple CryptoKit and were wondering about one design decision in particular: Why ist it that many of the types are modelled as enums instead of structs even if there are no cas…

---

## [Conditionally use CryptoKit](https://forums.swift.org/t/conditionally-use-cryptokit/30138)

<div class="topic-metadata">

**Author:** [@nick.keets](https://forums.swift.org/u/nick.keets)\
**Replies:** 15\
**Last updated:** [April 26, 2020, 1:27pm UTC](https://forums.swift.org/t/conditionally-use-cryptokit/30138 "2020-04-26T13:27:38Z")

</div>

Hello, I'm trying to implement an SHA1 extension that uses CryptoKit if it is available, otherwise falls back to CommonCrypto. This is what I've tried: #if canImport(CryptoKit) import CryptoKit extension Data { fun…

---

## [JWT generation using CryptoKit](https://forums.swift.org/t/jwt-generation-using-cryptokit/35495)

<div class="topic-metadata">

**Author:** [@prathameshk](https://forums.swift.org/u/prathameshk)\
**Replies:** 4\
**Last updated:** [April 20, 2020, 5:28am UTC](https://forums.swift.org/t/jwt-generation-using-cryptokit/35495 "2020-04-20T05:28:16Z")

</div>

Is there a way to generate/sign a JWT using CryptoKit? I know there are capable third-party libraries like IBM JWT and CupertinoJWT. However, I’d like to avoid using them as much as possible, especially if it can be ach…

---

## [CryptoKit: SHA256 much much slower than \`CryptoSwift\`](https://forums.swift.org/t/cryptokit-sha256-much-much-slower-than-cryptoswift/27983)

<div class="topic-metadata">

**Author:** [@Sajjon](https://forums.swift.org/u/Sajjon)\
**Replies:** 15\
**Last updated:** [August 28, 2019, 12:35pm UTC](https://forums.swift.org/t/cryptokit-sha256-much-much-slower-than-cryptoswift/27983 "2019-08-28T12:35:43Z")

</div>

Hey, CryptoKit's SHA256 (using it twice), is 3 times slower than CryptoSwift's implementation. I was hoping it would be the other way around. Is this poor performance something being address currently? I know CryptoKit …
