Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

322
Views
How can I generate an RSA key pair in Swift on Linux?

I know that when using Swift on iOS or macOS you can use SecKeyGeneratePair, but the Security library is unavailable on Linux. Short of falling back on Process to use the the OpenSSL CLI interface, is there any way to generate an RSA key pair in Swift.

FYI, I'm using Vapor 3 to build a web API.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can use the cross-platform library Themis (Apache 2) + example Swift wrappers. The nice thing is that you can use the same API regardless of programming language or location (back/front).

You can generate both RSA & EC keys. Tested on Vapor + Ubuntu 16.04

over 4 years ago · Santiago Trujillo Report

0

So this is many months later, but I thought I would at least update for any others. While I looked into Andrei's suggestion above to use Themis, in the end it really was simplest to simply use Process that I was avoiding originally.

I had to call some local scripts anyway, so I wrote a dead simple Shell class that wrapped Swift's Process. It's not multithreaded, so it's not great for performance. But it works for what I need. I just called OpenSSL's CLI and grabbed the output.

Shell Gist: https://gist.github.com/mattmaddux/9979ec992c2b9744b669bd1728c28c19

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!