| 257 | } |
| 258 | |
| 259 | bool EditorUtilities::GenerateCertificate(const String& name, const String& outputPfxFilePath) |
| 260 | { |
| 261 | // Generate temp files paths |
| 262 | const auto id = Guid::New().ToString(Guid::FormatType::D); |
| 263 | auto outputCerFilePath = Globals::TemporaryFolder / id; |
| 264 | const auto outputPvkFilePath = outputCerFilePath + TEXT(".pvk"); |
| 265 | outputCerFilePath += TEXT(".cer"); |
| 266 | |
| 267 | // Generate .pfx file |
| 268 | const bool result = GenerateCertificate(name, outputPfxFilePath, outputCerFilePath, outputPvkFilePath); |
| 269 | |
| 270 | // Cleanup unused files |
| 271 | if (FileSystem::FileExists(outputCerFilePath)) |
| 272 | FileSystem::DeleteFile(outputCerFilePath); |
| 273 | if (FileSystem::FileExists(outputPvkFilePath)) |
| 274 | FileSystem::DeleteFile(outputPvkFilePath); |
| 275 | |
| 276 | return result; |
| 277 | } |
| 278 | |
| 279 | bool EditorUtilities::GenerateCertificate(const String& name, const String& outputPfxFilePath, const String& outputCerFilePath, const String& outputPvkFilePath) |
| 280 | { |