Comments (7)
@hdoria Thanks for opening an issue! What's the content of error
?
from swiftyrsa.
key: (null) - Error Domain=SwiftyRSA.SwiftyRSAError Code=1 "(null)"
from swiftyrsa.
I've created a new Swift project and now I can see the full error:
SwiftyRSAError(message: "Invalid byte at index 18 (51) for public key header"): file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-800.0.63/src/swift/stdlib/public/core/ErrorType.swift, line 178
The certificate is below. What am I missing?
from swiftyrsa.
@hdoria Got it, you're trying to load a certificate as opposed to a public/private key. To fix this, you'll need to extract the public key with openssl:
openssl x509 -pubkey -noout -in cert.pem > pubkey.pem
See http://stackoverflow.com/questions/17143606/how-to-save-public-key-from-a-certificate-in-pem-format
Eventually we might want to add public key extraction from a certificate.
from swiftyrsa.
I'm still having trouble getting my .der file to be a valid Public Key. How could you do the above command with a .der file, I'm not having any luck. Or better yet, how can I just get the .der file to work in the constructor. I tried both with and without the Bundle parameter (I just used Bundle.main)
from swiftyrsa.
@mattbarker016 Any chance you could share this DER file here?
from swiftyrsa.
I think I resolved my issue, can you see if it checks out? It's a closed issue from today, July 21.
from swiftyrsa.
Related Issues (20)
- SwiftyRSA.prependX509KeyHeader is internal HOT 1
- RSA/ECB/OAEPWithSHA1AndMGF1Padding at server side HOT 1
- How can I see the internal data?
- I can't use it on iOS 16 HOT 2
- Modulus value
- SecPadding is deprecated. Replaced with SecKeyAlgorithm HOT 1
- Add PSS padding and salt length parameters
- AAAAAAAAAAAAAAAAAAA = HOT 10
- How to use the private key for encryption and the public key for decryption
- KMM (Kotlin Multiplatform Mobile) Support
- Question: Is there a way to create a user-driven private key?
- Support for Swift Packages
- Apple export compliance HOT 2
- Many methods were deprecated in iOS 15.0, please update
- Document how to import headers
- Cannot build with SPM HOT 1
- Base64 Decoding Failed (asn1ParsingFailed)
- Extension crashed❗️It seems Apple is internally using this open source package since iOS 17❗️
- Need for Privacy Manifest file HOT 4
- App is Encoding Sensitive Information Using Outdated or In- secure Cryptography
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftyrsa.