| | 1 | |
|
| | 2 | | using Org.BouncyCastle.Crypto; |
| | 3 | |
|
| | 4 | | namespace Kestrun.Certificates; |
| | 5 | | /// <summary> |
| | 6 | | /// Represents the result of creating a Certificate Signing Request (CSR), including the PEM-encoded CSR and the private |
| | 7 | | /// </summary> |
| | 8 | | /// <param name="CsrPem">The PEM-encoded CSR string.</param> |
| | 9 | | /// <param name="CsrDer">The DER-encoded CSR bytes.</param> |
| | 10 | | /// <param name="PrivateKey">The private key associated with the CSR.</param> |
| | 11 | | /// <param name="PrivateKeyPem">The PEM-encoded private key string.</param> |
| | 12 | | /// <param name="PrivateKeyDer">The DER-encoded private key bytes.</param> |
| | 13 | | /// <param name="PrivateKeyPemEncrypted">The PEM-encoded encrypted private key string, if an encryption password was pro |
| | 14 | | /// <param name="PublicKeyPem">The PEM-encoded public key string.</param> |
| | 15 | | /// <param name="PublicKeyDer">The DER-encoded public key bytes.</param> |
| 2 | 16 | | public record CsrResult( |
| 2 | 17 | | // CSR |
| 3 | 18 | | string CsrPem, |
| 0 | 19 | | byte[] CsrDer, |
| 2 | 20 | |
|
| 2 | 21 | | // Private key |
| 3 | 22 | | AsymmetricKeyParameter PrivateKey, // for programmatic use |
| 0 | 23 | | string PrivateKeyPem, // -----BEGIN PRIVATE KEY----- |
| 0 | 24 | | byte[] PrivateKeyDer, // PKCS#8 DER |
| 0 | 25 | | string? PrivateKeyPemEncrypted, // -----BEGIN ENCRYPTED PRIVATE KEY----- (if password provided) |
| 2 | 26 | |
|
| 2 | 27 | | // Public key |
| 0 | 28 | | string PublicKeyPem, // -----BEGIN PUBLIC KEY----- |
| 0 | 29 | | byte[] PublicKeyDer |
| 2 | 30 | | ); |