Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

324
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda