Skip to content
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

Bug: strange path resolving in createXXXXX (withPEMNamed pemName: String, onPath path: String) #61

Open
HashedViking opened this issue Feb 4, 2020 · 0 comments

Comments

@HashedViking
Copy link

HashedViking commented Feb 4, 2020

I may misunderstand something here, but when I build my the project the following code fails:
try CryptorRSA.createPrivateKey(withPEMNamed: "private.pem", onPath: "/Resources/")

trying to find the key file at that path:
<path_to_xcode_project_derived_data>/SourcePackages/checkouts/BlueRSA/Sources/CryptorRSA/CryptorRSAKey.swift/Resources/private_key.pem

Code causing the problem in createPrivateKey function:
let fullPath = URL(fileURLWithPath: #file).appendingPathComponent( path.appending(certName) ).standardized
Is appending path to CryptorRSAKey.swift file is supposed to be working?

Workaround is to get the content of a .pem file yourself:
try CryptorRSA.createPrivateKey(withPEM: privateKey())

The same problem with any createXXXXX (pemName/derName, onPath) function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant