Bug: strange path resolving in createXXXXX (withPEMNamed pemName: String, onPath path: String)
- Dominant language
- Swift
- Stars
- 136
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
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:
_/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.
Contributor guide
Assessment
This issue has not been assessed yet.