x509certificate - 如何在Corda中手动生成网络参数

标签 x509certificate corda

我已经手动创建并分发了 Corda 节点所需的证书。现在要启动节点,除其他外,它们需要有一个网络参数。问题是,如果我使用 Corda 网络 Bootstrap 工具生成网络参数,该文件将由另一个发行者签名(“C=UK,L=London,OU=corda,O=R3,CN=Corda Node Root CA ") 这与我的证书的颁发者不同。我的问题是如何手动创建网络参数以便指定正确的发行者以避免在节点启动期间发生冲突?

enter image description here

最佳答案

所以我想出了一种创建网络参数的方法:

private fun getSignedNetworkParameters(): NetworkParameters {

        //load the notary from a Keystore. This avoids having to start a flow from a node in order to retrieve NotaryInfo
        val notary = loadKeyStore("\\path-to-keystore\\keystore.jks", "keystore-password")

        val certificateAndKeyPair : CertificateAndKeyPair = notary.getCertificateAndKeyPair("entry-alias", "entry-password")
        val notaryParty = Party(certificateAndKeyPair.certificate)
        val notaryInfo = listOf(NotaryInfo(notaryParty, false))

        //map contract ID to the SHA-256 hash of its CorDapp contracts&states JAR file
        val whitelistedContractImplementations = mapOf(
                TestContract.TEST_CONTRACT_ID to listOf(getCheckSum(contractFile))
        )

        return NetworkParameters(minimumPlatformVersion = 3, notaries = notaryInfo,
                maxMessageSize = n, maxTransactionSize = n, modifiedTime = Instant.now(),
                epoch = 1, whitelistedContractImplementations = whitelistedContractImplementations)
    }

关于x509certificate - 如何在Corda中手动生成网络参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55743730/

相关文章:

C# 如何验证来自电子邮件的数字签名(编码 SeveBit)

c# - 从磁盘 .Net Core 加载 X509 证书

delphi - 从 Delphi 访问 Mozilla 证书

corda - java.io.NotSerializableException : Constructor parameter arg0 doesn't refer to a property of class

unit-testing - 如何在 Intellij 中导入目录/完整包以进行测试

kotlin - Corda-IOU演示在Windows上不起作用

javascript - 如何使用 node-forge 从 x.509 获得 AWS 使用的相同指纹?

ssl - 如何使用 OpenSSL 生成带有 SubjectAltName 的自签名证书?

corda - 如何从字符串创建派对对象?

intellij-idea - IntelliJ中的Gradle更新破坏了外部库DSL