小编ade*_*izu的帖子

如何使用 Xcode 11 注册关联域?

我一直在尝试将关联域功能添加到我的应用程序,但无法使用 Xcode 11 找到它。此功能在 11 版中被禁用了吗? 在此处输入图片说明

associated-domains xcode11

18
推荐指数
3
解决办法
5454
查看次数

使用 PGP (BouncyGPG) 加密大文件并在 Kotlin 中通过 SFTP (JSch) 发送

我一直在尝试使用 PGP 加密大文件(我为此使用 BouncyGPG)并使用 SFTP(使用 JSch)将其发送到远程服务器。我正在使用 PipedOutputStream 和 PipedInputStream 来避免在发送到服务器之前将最终加密的文件保存在本地。我相信因此 BouncyGPG 行为不端。

谁能帮我这个?

这是我的代码:

    BouncyGPG.registerProvider()

    private val bufferSize: Int = 8 * 1024

    fun sendFileSFTP(myFile: MyFile {
        PipedInputStream().use { input ->
            GlobalScope.launch {
                PipedOutputStream(input).use { output ->
                    encrypt(myFile, output)
                }
            }
            sendSFTP(input, "mysftp-directory/${myFile.filename}")
            log.info("Finished Sending $myFile")
        }
    }

    fun encrypt(myFile: MyFile output: OutputStream) {
        log.info("ENCRYPTING - $myFile")
        val pubkey = "/home/myhome/server.gpg"
        val privkey = "/home/myhome/server.secret.gpg"
        val password = "password"
        val keyring = KeyringConfigs.forGpgExportedKeys(KeyringConfigCallbacks.withPassword(password))
        keyring.addPublicKey(FileReader(File(pubkey)).readText().toByteArray(charset("US-ASCII")))
        keyring.addSecretKey(FileReader(File(privkey)).readText().toByteArray(charset("US-ASCII")))


        BouncyGPG.encryptToStream()
            .withConfig(keyring)
            .withStrongAlgorithms()
            .toRecipients("contact@myserver.com")
            .andDoNotSign() …
Run Code Online (Sandbox Code Playgroud)

gnupg jsch kotlin

6
推荐指数
1
解决办法
67
查看次数

如何使用 iOS 生成的 SDK for AWS API Gateway (Swift)

我已经使用 AWS API Gateway 创建了一个 API,但是每当我尝试访问任何资源时,都会收到此错误。

Error Domain=com.amazonaws.AWSAPIGatewayErrorDomain Code=1 "(null)" UserInfo={HTTPBody=<CFBasicHash 0x7fd5d87baaf0 [0x102c007b0]>{type = immutable dict, count = 1,
entries =>
0 : message = <CFString 0x7fd5d87bf100 [0x102c007b0]>{contents = "Not able to access resource."}
}
, HTTPHeaderFields=<CFBasicHash 0x7fd5d87bf2a0 [0x102c007b0]>{type = immutable dict, count = 8,
entries =>
0 : X-Cache = <CFString 0x7fd5d87bf030 [0x102c007b0]>{contents = "Error from cloudfront"}
1 : Content-Type = <CFString 0x7fd5d87bd900 [0x102c007b0]>{contents = "application/json"}
3 : x-amzn-RequestId = <CFString 0x7fd5d87baa70 [0x102c007b0]>{contents = "2728fe5f-51b0-11e5-8d25-ada09d3fa091"}
4 : Via = …
Run Code Online (Sandbox Code Playgroud)

sdk ios swift aws-api-gateway

3
推荐指数
1
解决办法
2596
查看次数

标签 统计

associated-domains ×1

aws-api-gateway ×1

gnupg ×1

ios ×1

jsch ×1

kotlin ×1

sdk ×1

swift ×1

xcode11 ×1