diff --git a/node/src/main/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelper.kt b/node/src/main/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelper.kt index 02ef6fb12c..b7f855a7af 100644 --- a/node/src/main/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelper.kt +++ b/node/src/main/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelper.kt @@ -19,11 +19,8 @@ import java.security.cert.Certificate import kotlin.system.exitProcess /** - * This checks the config.certificatesDirectory field for certificates required to connect to a Corda network. - * If the certificates are not found, a [org.bouncycastle.pkcs.PKCS10CertificationRequest] will be submitted to - * Corda network permissioning server using [NetworkRegistrationService]. This process will enter a polling loop until - * the request has been approved, and then the certificate chain will be downloaded and stored in [KeyStore] reside in - * the certificates directory. + * Helper for managing the node registration process, which checks for any existing certificates and requests them if + * needed. */ class NetworkRegistrationHelper(val config: NodeConfiguration, val certService: NetworkRegistrationService) { companion object { @@ -36,6 +33,17 @@ class NetworkRegistrationHelper(val config: NodeConfiguration, val certService: // TODO: Use different password for private key. private val privateKeyPassword = config.keyStorePassword + /** + * Ensure the initial keystore for a node is set up; note that this function may cause the process to exit under + * some circumstances. + * + * This checks the "config.certificatesDirectory" field for certificates required to connect to a Corda network. + * If the certificates are not found, a PKCS #10 certification request will be submitted to the + * Corda network permissioning server via [NetworkRegistrationService]. This process will enter a polling loop until + * the request has been approved, and then the certificate chain will be downloaded and stored in [KeyStore] reside in + * the certificates directory. + */ + // TODO: Stop killing the calling process from within a called function. fun buildKeystore() { validateX500Name(config.myLegalName) config.certificatesDirectory.createDirectories()