mirror of
https://github.com/corda/corda.git
synced 2025-06-17 06:38:21 +00:00
Enforce X.500 distinguished names in configuration
This commit is contained in:
@ -110,6 +110,8 @@ object X509Utilities {
|
||||
* Return a bogus X509 for dev purposes. Use [getX509Name] for something more real.
|
||||
*/
|
||||
fun getDevX509Name(commonName: String): X500Name {
|
||||
// Check that we haven't been accidentally given a full X500 distinguished name
|
||||
require(!commonName.startsWith("CN=")) { "Provided common name must not start \"CN=\"" }
|
||||
val nameBuilder = X500NameBuilder(BCStyle.INSTANCE)
|
||||
nameBuilder.addRDN(BCStyle.CN, commonName)
|
||||
nameBuilder.addRDN(BCStyle.O, "R3")
|
||||
|
Reference in New Issue
Block a user