Code Monkey home page Code Monkey logo

Comments (7)

ldiqual avatar ldiqual commented on August 17, 2024

@hdoria Thanks for opening an issue! What's the content of error?

from swiftyrsa.

hdoria avatar hdoria commented on August 17, 2024

key: (null) - Error Domain=SwiftyRSA.SwiftyRSAError Code=1 "(null)"

from swiftyrsa.

hdoria avatar hdoria commented on August 17, 2024

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?

certificado.der.zip

from swiftyrsa.

ldiqual avatar ldiqual commented on August 17, 2024

@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.

mattbarker016 avatar mattbarker016 commented on August 17, 2024

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.

ldiqual avatar ldiqual commented on August 17, 2024

@mattbarker016 Any chance you could share this DER file here?

from swiftyrsa.

mattbarker016 avatar mattbarker016 commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.