New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add RSA #39

Merged
merged 5 commits into from Feb 28, 2018

Conversation

1 participant
@tanner0101
Copy link
Member

tanner0101 commented Feb 27, 2018

  • macOS Security-based RSA
  • linux OpenSSL-based RSA
  • public, generic RSA impl based on both versions
import Crypto

let privateKey: Data = ...
let publicKey: Data = ...
let plaintext = Data("vapor".utf8)

// sign with private key
let privateRSA = RSA(key: .private2048(privateKey))
let signature = try privateRSA.sign(plaintext)

// verify with public key
let publicRSA = RSA(key: .public2048(publicKey))
if try publicRSA.verify(signature, signs: plaintext) { 
    print("signature verified") 
}

@tanner0101 tanner0101 added this to the 3.0.0-rc.1.1 milestone Feb 27, 2018

@tanner0101 tanner0101 self-assigned this Feb 27, 2018

tanner0101 added some commits Feb 27, 2018

@tanner0101 tanner0101 merged commit f510082 into master Feb 28, 2018

1 check passed

ci/circleci: linux Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment