| | | 1 | | using Org.BouncyCastle.Asn1.X509; |
| | | 2 | | |
| | | 3 | | namespace Kestrun.Certificates; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Options for creating a self-signed certificate. |
| | | 7 | | /// </summary> |
| | | 8 | | /// <param name="DnsNames">The DNS names to include in the certificate's Subject Alternative Name (SAN) extension.</para |
| | | 9 | | /// <param name="KeyType">The type of cryptographic key to use (RSA or ECDSA).</param> |
| | | 10 | | /// <param name="KeyLength">The length of the cryptographic key in bits.</param> |
| | | 11 | | /// <param name="Purposes">The key purposes (Extended Key Usage) for the certificate.</param> |
| | | 12 | | /// <param name="ValidDays">The number of days the certificate will be valid.</param> |
| | | 13 | | /// <param name="Ephemeral">If true, the certificate will not be stored in the Windows certificate store.</param> |
| | | 14 | | /// <param name="Exportable">If true, the private key can be exported from the certificate.</param> |
| | | 15 | | /// <remarks> |
| | | 16 | | /// This record is used to specify options for creating a self-signed certificate. |
| | | 17 | | /// </remarks> |
| | 12 | 18 | | public record SelfSignedOptions( |
| | 24 | 19 | | IEnumerable<string> DnsNames, |
| | 24 | 20 | | KeyType KeyType = KeyType.Rsa, |
| | 12 | 21 | | int KeyLength = 2048, |
| | 12 | 22 | | IEnumerable<KeyPurposeID>? Purposes = null, |
| | 12 | 23 | | int ValidDays = 365, |
| | 12 | 24 | | bool Ephemeral = false, |
| | 12 | 25 | | bool Exportable = false |
| | 12 | 26 | | ); |