@ SneakyThrows protected Pair < String , String > generateCertificateAndKey ( ) { try ( val certWriter = new StringWriter ( ) ; val keyWriter = new StringWriter ( ) ) { samlIdPMetadataGeneratorConfigurationContext . getSamlIdPCertificateAndKeyWriter ( ) . writeCertificateAndKey ( keyWriter , certWriter ) ; val encryptionKey = samlIdPMetadataGeneratorConfigurationContext . getMetadataCipherExecutor ( ) . encode ( keyWriter . toString ( ) ) ; return Pair . of ( certWriter . toString ( ) , encryptionKey ) ; } }
Generate certificate and key pair .