├── .gitattributes ├── .gitignore ├── ACMESharp ├── ACMESharp-test │ ├── ACMESharp-test.csproj │ ├── AcmeClientUnitTests.cs │ ├── AcmeUnitTests.cs │ ├── CertificateProviderTests-Certificate.der │ ├── CertificateProviderTests-Certificate.pem │ ├── CertificateProviderTests-ICA-Certificate.der │ ├── CertificateProviderTests-ICA-Certificate.pem │ ├── CertificateProviderTests-PKey.pem │ ├── CertificateProviderTests.cs │ ├── CertificateProviderTests.key.json │ ├── ChallengeHandlerTests.cs │ ├── DnsUnitTests.cs │ ├── JsonTests.cs │ ├── JwsHelperUnitTests.cs │ ├── JwsUnitTests.cs │ ├── OrderedIntegrationTests.playlist │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ ├── ce-key.der │ ├── ce-key.pem │ ├── config │ │ ├── dnsInfo.json.enc │ │ ├── dnsInfo.json.sample │ │ ├── secure-dnsInfo.ps1 │ │ ├── secure-testProxyConfig.ps1 │ │ ├── secure-webServerInfo.ps1 │ │ ├── testProxyConfig.json.enc │ │ ├── testProxyConfig.json.sample │ │ ├── webServerInfo.json.enc │ │ └── webServerInfo.json.sample │ └── packages.config ├── ACMESharp.OpenSSL-test │ ├── ACMESharp.OpenSSL-test.csproj │ ├── OpenSslUnitTests.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── ACMESharp.PKI.Providers.BouncyCastle │ ├── ACMESharp.PKI.Providers.BouncyCastle.csproj │ ├── BCPkiTool.cs │ ├── BCPkiToolProvider.cs │ ├── BouncyCastleProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── ACMESharp.PKI.Providers.OpenSslCli │ ├── ACMESharp.PKI.Providers.OpenSslCli.csproj │ ├── OSSLCliPkiTool.cs │ ├── OSSLCliPkiToolProvider.cs │ ├── OpenSslCliProvider.cs │ ├── OpenSslCliProvider_Config.txt │ ├── Properties │ │ └── AssemblyInfo.cs │ └── openssl-win32-bin │ │ ├── 4758cca.dll │ │ ├── aep.dll │ │ ├── atalla.dll │ │ ├── capi.dll │ │ ├── chil.dll │ │ ├── cswift.dll │ │ ├── gmp.dll │ │ ├── gost.dll │ │ ├── libeay32.dll │ │ ├── msvcr120.dll │ │ ├── nuron.dll │ │ ├── openssl.exe │ │ ├── padlock.dll │ │ ├── ssleay32.dll │ │ ├── sureware.dll │ │ └── ubsec.dll ├── ACMESharp.PKI.Providers.OpenSslLib │ ├── ACMESharp.PKI.Providers.OpenSslLib.csproj │ ├── OSSLLibPkiTool.cs │ ├── OSSLLibPkiToolProvider.cs │ ├── OpenSslLibProvider.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── ACMESharp.PKI.Providers.OpenSslLib32 │ ├── ACMESharp.PKI.Providers.OpenSslLib32.csproj │ ├── ACMESharp.PKI.Providers.OpenSslLib32.nuspec │ ├── OpenSslLib32Provider.cs │ ├── OpenSslLibBaseProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── ACMESharp.PKI.Providers.OpenSslLib64 │ ├── ACMESharp.PKI.Providers.OpenSslLib64.csproj │ ├── ACMESharp.PKI.Providers.OpenSslLib64.nuspec │ ├── OpenSslLib64Provider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── ACMESharp.POSH-test │ ├── ACMESharp.POSH-test.csproj │ ├── Pester │ │ ├── 000-Common.ps1 │ │ ├── 010-Vault.Tests.ps1 │ │ ├── 020-Acme.Tests.ps1 │ │ ├── 110-IisProvider.Tests.ps1 │ │ └── 120-AwsProvider.Tests.ps1 │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README-PESTER.txt │ ├── app.config │ └── choco │ │ ├── acmesharp-posh-all │ │ ├── acmesharp-posh-all.nuspec │ │ ├── choco-pack.cmd │ │ ├── choco-test-install.cmd │ │ ├── choco-test-uninstall.cmd │ │ └── tools │ │ │ ├── ReadMe.md │ │ │ ├── chocolateyinstall.ps1 │ │ │ └── chocolateyuninstall.ps1 │ │ └── test.ps1 ├── ACMESharp.POSH │ ├── ACMESharp-AWS │ │ ├── ACMESharp-AWS.psd1 │ │ └── ACMESharp-AWS.psm1 │ ├── ACMESharp-Extensions │ │ ├── ACMESharp-Extensions.psd1 │ │ └── ACMESharp-Extensions.psm1 │ ├── ACMESharp-IIS │ │ ├── ACMESharp-IIS.psd1 │ │ └── ACMESharp-IIS.psm1 │ ├── ACMESharp.POSH.csproj │ ├── ACMESharp.POSH.nuspec │ ├── ACMESharp.psd1 │ ├── AcmeCmdlet.cs │ ├── CompleteChallenge.cs │ ├── ExportExtensions-config.psd1 │ ├── ExportExtensions.ps1 │ ├── GetCertificate.cs │ ├── GetChallengeHandlerProfile.cs │ ├── GetIdentifier.cs │ ├── GetInstallerProfile.cs │ ├── GetIssuerCertificate.cs │ ├── GetRegistration.cs │ ├── GetVault.cs │ ├── GetVaultProfile.cs │ ├── InitializeVault.cs │ ├── InstallCertificate.cs │ ├── NLog.config.sample │ ├── NLog.xsd │ ├── NewCertificate.cs │ ├── NewIdentifier.cs │ ├── NewRegistration.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README-TESTING.txt │ ├── SetChallengeHandlerProfile.cs │ ├── SetInstallerProfile.cs │ ├── SetProxy.cs │ ├── SetServerDirectory.cs │ ├── SetVault.cs │ ├── SetVaultProfile.cs │ ├── SubmitCertificate.cs │ ├── SubmitChallenge.cs │ ├── UpdateCertificate.cs │ ├── UpdateIdentifier.cs │ ├── UpdateRegistration.cs │ ├── Util │ │ ├── ClientHelper.cs │ │ ├── PkiHelper.cs │ │ ├── PoshHelper.cs │ │ └── VaultHelper.cs │ ├── choco │ │ ├── acmesharp-posh │ │ │ ├── acmesharp-posh-ea.nuspec │ │ │ ├── choco-pack.cmd │ │ │ ├── choco-test-install.cmd │ │ │ ├── choco-test-uninstall.cmd │ │ │ └── tools │ │ │ │ ├── ReadMe.md │ │ │ │ ├── chocolateyinstall.ps1 │ │ │ │ ├── chocolateyinstall.ps1-ORIG │ │ │ │ ├── chocolateyuninstall.ps1 │ │ │ │ └── chocolateyuninstall.ps1-ORIG │ │ └── test.ps1 │ ├── en-US │ │ ├── ACMESharp.POSH.dll-Help.xml │ │ ├── about_ACMESharp.help.txt │ │ └── about_LetsEncrypt.help.txt │ └── packages.config ├── ACMESharp.Providers-test │ ├── ACMESharp.Providers-test.csproj │ ├── AwsRoute53ProviderTests.cs │ ├── AwsS3ProviderTests.cs │ ├── CloudFlareTests.cs │ ├── Config │ │ ├── AwsR53HandlerParams.cs │ │ ├── AwsR53HandlerParams.json.enc │ │ ├── AwsR53HandlerParams.json.sample │ │ ├── AwsS3HandlerParams.cs │ │ ├── AwsS3HandlerParams.json.enc │ │ ├── AwsS3HandlerParams.json.sample │ │ ├── BaseParams.cs │ │ ├── CloudFlareHandlerParams.json.enc │ │ ├── CloudFlareHandlerParams.json.sample │ │ ├── IisHandlerParams.cs │ │ ├── secure-AllParamsJson.ps1 │ │ └── secure-files.ps1 │ ├── IisProviderTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── TestCommon.cs │ ├── app.config │ └── packages.config ├── ACMESharp.Providers.AWS │ ├── ACMESharp.Providers.AWS.csproj │ ├── ACMESharp.Providers.AWS.nuspec │ ├── ACMESharp.Providers.AWS.psd1 │ ├── AwsCommonParams.cs │ ├── AwsElbInstaller.cs │ ├── AwsElbInstallerProvider.cs │ ├── AwsIamCertificateInstaller.cs │ ├── AwsIamCertificateInstallerProvider.cs │ ├── AwsRoute53ChallengeHandler.cs │ ├── AwsRoute53ChallengeHandlerProvider.cs │ ├── AwsS3ChallengeHandler.cs │ ├── AwsS3ChallengeHandlerProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Route53Helper.cs │ └── packages.config ├── ACMESharp.Providers.CloudFlare │ ├── ACMESharp.Providers.CloudFlare.csproj │ ├── ACMESharp.Providers.CloudFlare.nuspec │ ├── ACMESharp.Providers.CloudFlare.psd1 │ ├── CloudFlareChallengeHandler.cs │ ├── CloudFlareChallengeHandlerProvider.cs │ ├── CloudFlareHelper.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Results │ │ ├── DnsRecord.cs │ │ ├── DnsResult.cs │ │ ├── ResultInfo.cs │ │ ├── Zone.cs │ │ └── ZoneResult.cs │ └── packages.config ├── ACMESharp.Providers.DNSMadeEasy │ ├── ACMESharp.Providers.DNSMadeEasy.csproj │ ├── ACMESharp.Providers.DNSMadeEasy.nuspec │ ├── ACMESharp.Providers.DNSMadeEasy.psd1 │ ├── DnsMadeEasyChallengeHandler.cs │ ├── DnsMadeEasyChallengeHandlerProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── ACMESharp.Providers.DuckDNS │ ├── ACMESharp.Providers.DuckDNS.csproj │ ├── ACMESharp.Providers.DuckDNS.nuspec │ ├── ACMESharp.Providers.DuckDNS.psd1 │ ├── DuckDnsChallengeHandler.cs │ ├── DuckDnsChallengeHandlerProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── ACMESharp.Providers.IIS │ ├── ACMESharp.Providers.IIS.csproj │ ├── ACMESharp.Providers.IIS.nuspec │ ├── ACMESharp.Providers.IIS.psd1 │ ├── IisChallengeHandler-WebConfig │ ├── IisChallengeHandler.cs │ ├── IisChallengeHandlerProvider.cs │ ├── IisHelper.cs │ ├── IisInstaller.cs │ ├── IisInstallerProvider.cs │ ├── IisWebSiteBinding.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── ACMESharp.Providers.Windows │ ├── ACMESharp.Providers.Windows.csproj │ ├── ACMESharp.Providers.Windows.nuspec │ ├── ACMESharp.Providers.Windows.psd1 │ ├── MSDNSChallengeHandler.cs │ ├── MSDNSChallengeHandlerProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── WindowsCertificateStoreInstaller.cs │ └── WindowsCertificateStoreInstallerProvider.cs ├── ACMESharp.Vault-test │ ├── ACMESharp.Vault-test.csproj │ ├── LocalDiskVaultProviderTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── VaultProfileTests.cs ├── ACMESharp.Vault │ ├── ACMESharp.Vault.csproj │ ├── ACMESharp.Vault.nuspec │ ├── IVault.cs │ ├── IVaultProvider.cs │ ├── IVaultProviderInfo.cs │ ├── Model │ │ ├── CertificateInfo.cs │ │ ├── IdentifierInfo.cs │ │ ├── InstallerProfileInfo.cs │ │ ├── IssuerCertificateInfo.cs │ │ ├── ProviderProfileInfo.cs │ │ ├── ProxyConfig.cs │ │ ├── RegistrationInfo.cs │ │ └── VaultInfo.cs │ ├── Profile │ │ ├── InstallerProfile.cs │ │ ├── ProviderProfile.cs │ │ └── VaultProfileManager.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Providers │ │ ├── EntityMeta.cs │ │ ├── FileVaultAsset.cs │ │ ├── LocalDiskVault.cs │ │ └── LocalDiskVaultProvider.cs │ ├── Util │ │ ├── EntityDictionary.cs │ │ ├── EntityHelper.cs │ │ ├── EntityLookup.cs │ │ ├── IIdentifiable.cs │ │ ├── IndexedDictionary.cs │ │ └── OrderedNameMap.cs │ ├── VaultAsset.cs │ ├── VaultAssetType.cs │ ├── VaultExtManager.cs │ ├── VaultProviderAttribute.cs │ └── packages.config ├── ACMESharp.sln ├── ACMESharp │ ├── ACME │ │ ├── Challenge.cs │ │ ├── ChallengeAnswer.cs │ │ ├── ChallengeDecoderExtManager.cs │ │ ├── ChallengeDecoderProviderAttribute.cs │ │ ├── ChallengeHandlerExtManager.cs │ │ ├── ChallengeHandlerProviderAttribute.cs │ │ ├── ChallengeHandlingContext.cs │ │ ├── IChallengeDecoder.cs │ │ ├── IChallengeDecoderProviderInfo.cs │ │ ├── IChallengeHandler.cs │ │ ├── IChallengeHandlerProviderInfo.cs │ │ └── Providers │ │ │ ├── DnsChallengeDecoder.cs │ │ │ ├── DnsChallengeDecoderProvider.cs │ │ │ ├── HttpChallengeDecoder.cs │ │ │ ├── HttpChallengeDecoderProvider.cs │ │ │ ├── ManualChallengeHandler.cs │ │ │ ├── ManualChallengeHandlerProvider.cs │ │ │ ├── TlsSniChallengeDecoder.cs │ │ │ └── TlsSniChallengeDecoderProvider.cs │ ├── ACMESharp.csproj │ ├── ACMESharp.nuspec │ ├── AcmeClient.cs │ ├── AcmeException.cs │ ├── AcmeProtocol.cs │ ├── AcmeRegistration.cs │ ├── AcmeServerDirectory.cs │ ├── AuthorizationState.cs │ ├── AuthorizeChallenge.cs │ ├── Certificate.cs │ ├── CertificateRequest.cs │ ├── DNS │ │ ├── AwsRoute53DnsProvider.cs │ │ ├── DnsInfo.cs │ │ ├── IDnsProvider.cs │ │ └── ManualDnsProvider.cs │ ├── Ext │ │ ├── ExtCommon.cs │ │ ├── ExtManagerAttribute.cs │ │ ├── ExtRegistry.cs │ │ ├── IAliasesSupported.cs │ │ ├── IExtDetail.cs │ │ ├── NamedInfo.cs │ │ ├── ParameterDetail.cs │ │ └── ParameterExtensions.cs │ ├── HTTP │ │ ├── Link.cs │ │ └── LinkCollection.cs │ ├── Installer │ │ ├── IInstaller.cs │ │ ├── IInstallerProvider.cs │ │ ├── IInstallerProviderInfo.cs │ │ ├── InstallerExtManager.cs │ │ └── InstallerProviderAttribute.cs │ ├── JOSE │ │ ├── ISigner.cs │ │ ├── JwsHeaders.cs │ │ ├── JwsHelper.cs │ │ └── RS256Signer.cs │ ├── JSON │ │ └── AcmeJsonContractResolver.cs │ ├── Messages │ │ ├── AnswerDnsChallengeRequest.cs │ │ ├── AnswerHttpChallengeRequest.cs │ │ ├── AuthzStatusResponse.cs │ │ ├── ChallengeAnswerRequest.cs │ │ ├── ChallengePart.cs │ │ ├── IdentifierPart.cs │ │ ├── NewAuthzRequest.cs │ │ ├── NewAuthzResponse.cs │ │ ├── NewCertRequest.cs │ │ ├── NewRegRequest.cs │ │ ├── ProblemDetailResponse.cs │ │ ├── RegResponse.cs │ │ ├── RevokeCertRequest.cs │ │ └── UpdateRegRequest.cs │ ├── PKI │ │ ├── CertificateProvider.cs │ │ ├── Crt.cs │ │ ├── Csr.cs │ │ ├── CsrDetails.cs │ │ ├── CsrHelper.cs │ │ ├── CsrParams.cs │ │ ├── EC │ │ │ ├── EcPrivateKey.cs │ │ │ └── EcPrivateKeyParams.cs │ │ ├── IPkiTool.cs │ │ ├── IPkiToolProvider.cs │ │ ├── IPkiToolProviderInfo.cs │ │ ├── PkiFormats.cs │ │ ├── PkiToolExtManager.cs │ │ ├── PkiToolProviderAttribute.cs │ │ ├── PrivateKey.cs │ │ ├── Providers │ │ │ └── PkiToolBase.cs │ │ └── RSA │ │ │ ├── RsaPrivateKey.cs │ │ │ └── RsaPrivateKeyParams.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RequestMessage.cs │ ├── Util │ │ ├── BaseManualProvider.cs │ │ ├── ExceptionExtensions.cs │ │ ├── JsonHelper.cs │ │ ├── StringHelper.cs │ │ ├── SysHelper.cs │ │ └── TemporaryFile.cs │ ├── WebServer │ │ ├── AwsS3WebServerProvider.cs │ │ ├── IWebServerProvider.cs │ │ ├── IisSitePathProvider-WebConfig │ │ ├── IisSitePathProvider.cs │ │ ├── ManualWebServerProvider.cs │ │ └── WebServerInfo.cs │ └── packages.config ├── nuget-build.cmd └── shared │ ├── SharedAssemblyInfo.cs │ ├── SharedAssemblyVersionInfo.cs │ └── SharedGlobalSuppressions.cs ├── LICENSE ├── README.md ├── appveyor.yml ├── artwork ├── ACMESharp-logo-square.png ├── ACMESharp-logo-square64.png ├── ACMESharp-logo-transparent.png ├── ACMESharp-logo.png ├── ACMESharp-logo.svg ├── ACMESharp-logo128-transparent.png ├── ACMESharp-logo128.png ├── ACMESharp-logo64-transparent.png ├── ACMESharp-logo64.png └── ACMESharp1.vsdx ├── cSpell.json ├── ci ├── av-build.ps1 ├── av-install.ps1 ├── av-onfinish.ps1 ├── nuget-staging │ └── AWSPowerShell │ │ ├── AWSPowerShell.psd1 │ │ └── README.md ├── psorg │ ├── PS4-Step0.ps1 │ ├── PS4-Step1.ps1 │ └── PS4-Step2.ps1 └── version-bump.md └── tools ├── XmlDoc2CmdletDoc ├── Jolt.dll ├── Jolt.xml ├── System.Management.Automation.dll ├── XmlDoc2CmdletDoc.Core.dll ├── XmlDoc2CmdletDoc.Core.xml └── XmlDoc2CmdletDoc.exe ├── appveyor-connect.ps1 └── appveyor-connect.template.rdp /ACMESharp/ACMESharp-test/CertificateProviderTests-Certificate.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp-test/CertificateProviderTests-Certificate.der -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/CertificateProviderTests-Certificate.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFCTCCA/GgAwIBAgITAPoUJc42gjOG/ZnTI103smG+LTANBgkqhkiG9w0BAQsF 3 | ADAfMR0wGwYDVQQDDBRoYXBweSBoYWNrZXIgZmFrZSBDQTAeFw0xNTExMDcwNDU2 4 | MDBaFw0xNjAyMDUwNDU2MDBaMC0xKzApBgNVBAMTImFjbWUtd2luLXdzMi5hY21l 5 | dGVzdGluZy56eWJvcmcuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB 6 | AQCfrcgzGzk3ORJAfFRMkh9GhqefbqVcf0wD752fodn9RSgzxQH/gitP2Mn8uouP 7 | UmJGOVdca1XUG87D6Zs03g9ITOZ4PKPNxGlXcsnB+jd5LHHf//jdkDqhBGQ1gMmO 8 | jcaz5NvnWDrif5rVM85VZ3A3PYyLRQmQ0//Oby5cl5aXuGBoheBBG2SHBUFT8M8V 9 | 0xsyiav0ANl2YKKqknM1AwVibKjflTCPE+X+hblSP4RTr+b4lNZNb6ERklE+05Q1 10 | iGjMEGbIslGpNvQl0kzfIDCyxqPqf291S70PXRuZ9Qb3XF4EQwo9j7Nioep214YU 11 | D5myDRT3/I2qhMb1IGHx7gk9AgMBAAGjggIuMIICKjAOBgNVHQ8BAf8EBAMCBaAw 12 | HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYD 13 | VR0OBBYEFLTMQFDvTNgMvmR88GmadfO92LcsMB8GA1UdIwQYMBaAFPt4TxL5YBWD 14 | LJ8XfzQZsy426kGJMHgGCCsGAQUFBwEBBGwwajAzBggrBgEFBQcwAYYnaHR0cDov 15 | L29jc3Auc3RhZ2luZy14MS5sZXRzZW5jcnlwdC5vcmcvMDMGCCsGAQUFBzAChido 16 | dHRwOi8vY2VydC5zdGFnaW5nLXgxLmxldHNlbmNyeXB0Lm9yZy8wLQYDVR0RBCYw 17 | JIIiYWNtZS13aW4td3MyLmFjbWV0ZXN0aW5nLnp5Ym9yZy5pbzCCAQAGA1UdIASB 18 | +DCB9TAKBgZngQwBAgEwADCB5gYLKwYBBAGC3xMBAQEwgdYwJgYIKwYBBQUHAgEW 19 | Gmh0dHA6Ly9jcHMubGV0c2VuY3J5cHQub3JnMIGrBggrBgEFBQcCAjCBngyBm1Ro 20 | aXMgQ2VydGlmaWNhdGUgbWF5IG9ubHkgYmUgcmVsaWVkIHVwb24gYnkgUmVseWlu 21 | ZyBQYXJ0aWVzIGFuZCBvbmx5IGluIGFjY29yZGFuY2Ugd2l0aCB0aGUgQ2VydGlm 22 | aWNhdGUgUG9saWN5IGZvdW5kIGF0IGh0dHBzOi8vbGV0c2VuY3J5cHQub3JnL3Jl 23 | cG9zaXRvcnkvMA0GCSqGSIb3DQEBCwUAA4IBAQCQtva96AHPhUl0htuEn8yvQDQt 24 | 0SPb/DLXg85LZOlY+Do7KmCWpD2P4t2MKUePWWhv6OPRzS5bbPCx8eW2jYM3e6rj 25 | kHN+MR53brGy1un6SU1Mc15qJxKKVXQF3Rut8PQQifEFvMEYao7exQDzhfnJmtTK 26 | S796nqRFsjkNsFHmlLVUsUdpHnPlE1JfmwqYUsIIOQ67JmCAUjbC4SFmk0WE+QDi 27 | ybBOlg+oj7s4IjeriuamDn+9nhogYM1CIh2kYC2iKR4pRg8MaDtPCHAYi8IuO4c+ 28 | kCbwqMYJuKCpxpDwAePDo8sDT0qdMDoVyICSetnankqcD3EFfEtLCddOagQ/ 29 | -----END CERTIFICATE----- 30 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/CertificateProviderTests-ICA-Certificate.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp-test/CertificateProviderTests-ICA-Certificate.der -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/CertificateProviderTests-ICA-Certificate.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDETCCAfmgAwIBAgIJAJzxkS6o1QkIMA0GCSqGSIb3DQEBCwUAMB8xHTAbBgNV 3 | BAMMFGhhcHB5IGhhY2tlciBmYWtlIENBMB4XDTE1MDQwNzIzNTAzOFoXDTI1MDQw 4 | NDIzNTAzOFowHzEdMBsGA1UEAwwUaGFwcHkgaGFja2VyIGZha2UgQ0EwggEiMA0G 5 | CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDCCkd5mgXFErJ3F2M0E9dw+Ta/md5i 6 | 8TDId01HberAApqmydG7UZYF3zLTSzNjlNSOmtybvrSGUnZ9r9tSQcL8VM6WUOM8 7 | tnIpiIjEA2QkBycMwvRmZ/B2ltPdYs/R9BqNwO1g18GDZrHSzUYtNKNeFI6Glamj 8 | 7GK2Vr0SmiEamlNIR5ktAFsEErzf/d4jCF7sosMsJpMCm1p58QkP4LHLShVLXDa8 9 | BMfVoI+ipYcA08iNUFkgW8VWDclIDxcysa0psDDtMjX3+4aPkE/cefmP+1xOfUuD 10 | HOGV8XFynsP4EpTfVOZr0/g9gYQ7ZArqXX7GTQkFqduwPm/w5qxSPTarAgMBAAGj 11 | UDBOMB0GA1UdDgQWBBT7eE8S+WAVgyyfF380GbMuNupBiTAfBgNVHSMEGDAWgBT7 12 | eE8S+WAVgyyfF380GbMuNupBiTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUA 13 | A4IBAQAd9Da+Zv+TjMv7NTAmliqnWHY6d3UxEZN3hFEJ58IQVHbBZVZdW7zhRktB 14 | vR05Kweac0HJeK91TKmzvXl21IXLvh0gcNLU/uweD3no/snfdB4OoFompljThmgl 15 | zBqiqWoKBJQrLCA8w5UB+ReomRYd/EYXF/6TAfzm6hr//Xt5mPiUHPdvYt75lMAo 16 | vRxLSbF8TSQ6b7BYxISWjPgFASNNqJNHEItWsmQMtAjjwzb9cs01XH9pChVAWn9L 17 | oeMKa+SlHSYrWG93+EcrIH/dGU76uNOiaDzBSKvaehG53h25MHuO1anNICJvZovW 18 | rFo4Uv1EnkKJm3vJFe50eJGhEKlx 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/CertificateProviderTests-PKey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAlAFFxNF2bytMHSDDc1XiaeoewswiJpMxRbjMlby6QhmrHDGj 3 | a1mAWuTuW77zUQCJ49rxpPPeKycT5P86Z4zpY5w7P45IzxgFkKQgrY8StheHTx77 4 | hdqXlwLlHHHye2iGtX4F2fpRERpY7znIYFx4psNHJngrUeZMQAN6NrKgflXUKA3q 5 | uSSwkdg1lm+NCp4qXaz6fC94LiA5pDMLvTC5Oc+Fu3rWXm0yK7oDHPi7zDYbcgK6 6 | uq3roMCxZEUJEqunLN7izFsCubkucxFjOZkb1G4dJKXlDwQqJ+QBKuq3Ufy4Y8GY 7 | S7na+GdEqjzCYJn2Jn78CLUQ5MPirNjUSi1fDwIDAQABAoIBAG7D0QouVLt4JNt7 8 | xKqRcQQhIepZSYmjCPIMDphViPOlMCjGgW36qpPb1wM0kfZiN9Ad8FCp7fBPq5Tq 9 | 6jPLAnP43WKAQr8yVB/epVIezDsYurwdDNItONvcX8j9AiMXpBE6AnkS3A63sC1B 10 | ClQLgIQViy8gKhN+DjyuHY3H+1LwF59YoVVhbscvLRQZLDqRAsaOF74Ulqxiee5n 11 | wybiq/bW1yyABrodPSLGla8Ba+fvjN0OLuKuMgUiomqPF0fWlHSo/NxvLhG0zvXO 12 | 2kHpB2ErAKfGj2fipXadL2tRnU3ifgqFNEi9KU+pIllpK1xg9Ha1mGy7oPa1+SNX 13 | pPtthYECgYEAwspo+CAPwqzvEALeh5OflQ/3dQD0ph5XAAoj6v+Px49v9xcUvtTJ 14 | XDuT2mg1Z8cH+Ej8YoW9NCkNfBfqWXKJtpzKZTG5fxZnigKDSDtVejN6EnkraQr+ 15 | jorcfLN042K7dXKb6elE2qjA/kbjKWz7K5Oy/LwVomvJWcfbxL/jtc8CgYEAwoNF 16 | L/1Ot/PsFX+92DVCUI4GM9+z/f0thAbrEZx9uUWEqZVYQlYxFC4rHXh/kGm7LzrR 17 | WKKwoNGKIhmY6zTPbwzu2FJYmGwrpXBHiaXC2Xs8PQ3+vW80J0UOiu5SyUYXsE5F 18 | nXFEgblTeRevhupb+OiVf/vki1b6sS6Zm2KrUsECgYEAmceoZTMSnjNerHpHaite 19 | UhT/3Gw7uKW9M3fN8Wl+/iI8V4ruQtXEfj8+s6+PcfWMUjR0o+dHftVmIvDSf3lQ 20 | RU2073z5H971MNxY/n5xNf9LwSfN4KjgXHI+LWiTwCwjKE6pzlntlN6jNluKXRr/ 21 | k+CP7r0iK08C8BE7bDG9uLsCgYAQ8PX5tApDI0+Qn8udJSZddcE8i2NV39MzCJc4 22 | tXSNymw/iO5i+LbVlx/SNUiG/256MplBKwpPN3Dcf3Y+Jh9bALlcxe9Jd0Jl6l2Q 23 | s4tA/ebFOo7RWPol4XHez9sOBLjTdj3B9LeOxOFsTo/PJGJWT4uV1g6VxEGZZQGj 24 | 8vgRAQKBgD9ym6La0p9UHaOoxaywrQp/srJM1MQ/pTtmR+2CpYEyIiGHgaicCby9 25 | PZXo3rNJmVARtTd9bjG6m9KP0KbWv6JhOjluvJM756J8keAbnGNUHTrsQvVruTZJ 26 | IXlYZqclqmMvz+QuYBqt4/sueaapdgLVLMlcjUoEsMVV1SYz3vWB 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/CertificateProviderTests.key.json: -------------------------------------------------------------------------------- 1 | {"Bits":2048,"E":"010001","BigNumber":null,"Pem":"-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAn63IMxs5NzkSQHxUTJIfRoann26lXH9MA++dn6HZ/UUoM8UB\n/4IrT9jJ/LqLj1JiRjlXXGtV1BvOw+mbNN4PSEzmeDyjzcRpV3LJwfo3eSxx3//4\n3ZA6oQRkNYDJjo3Gs+Tb51g64n+a1TPOVWdwNz2Mi0UJkNP/zm8uXJeWl7hgaIXg\nQRtkhwVBU/DPFdMbMomr9ADZdmCiqpJzNQMFYmyo35UwjxPl/oW5Uj+EU6/m+JTW\nTW+hEZJRPtOUNYhozBBmyLJRqTb0JdJM3yAwssaj6n9vdUu9D10bmfUG91xeBEMK\nPY+zYqHqdteGFA+Zsg0U9/yNqoTG9SBh8e4JPQIDAQABAoIBAEWNKoCoQPm+0CZq\ngUWA+EJ98JFPXpO1luS4AE5B73OUJfi2vTIP/tGeugxtLNDWr5uq6lSFJDNpkVxg\naoxSlRGG/XQt5aOBA+llRGBLntIW+9r34eyQIBl2kjeDy0delchRzT8tfSifME/h\nauRkU8qb8pXPEmWVEf1XDDikhqG6q3WUIN3S+Lu5Ae5h6URcj0uIfIC3ThkLI5tu\njrbJjEGisqOjyGCMf9E3ekQntLYr4eS8qGKPx4ZGLWLZyOyHd5NO7nYbxYrG1xrj\n12YtppO50BYC5Le63if3j+/pcVw3tyRdBkrFnvKq3qAtUpvwtTdo0BR+IRXaT380\nNkh72HkCgYEA0XSv7PnoA2DkU5wPxsk7RUpEy/PIIElH413To0YEITcNPS1LAeLR\n64Qdkp7aApymVR53l5r8kNgelFuOp7PvJK21JCVAiIQwWyusyXBejBLDB28mgKRd\nU9uYKlZXDG4IUL4C/5B+Dbu+mUlDEd8eUkjiCzV61UN1ftwP9aK39g8CgYEAwylu\nngLP9JghxlGFGIde7YczmjOFKLwWyVIkggH4NbIZYNeXwVUQKr8ScJmonYRPJItx\nMW5z59UIBHqaNhzUuQ3Z0Yr6TKoEe3BjzWsWi45hKrvIU5xULj099Q2nQhFvSM2c\ng36Y/o7RzM0e6ZqzB+FtsVd7H6j60pFhloGp9/MCgYB+4YTAtRJLGaK2007rSHNT\nIg5SzjZo+HtHzEqsGXne9Q5cBNfvKIupc7rGWtwNwP8xiOdBO23MAF9l16CvDlzL\nhz63yqkxCYKRd/+PdzaO+76Q/lAAlZDDf77Jxsush+sZnkEKt2jkwNpQ2QR8CwC/\nL89eouLp1ZeTZZN1ZUCzGQKBgQCMYvZudalv0iuhhCyQu3getz34c40bA0oE4bDf\nUFljDs1Qq2U/rlfl1/KEyxPO00k3CZOQMlrv7n9I8YSS3mRrBbqlECsDEN4OiYdR\nUfIyy2W8Hr543qBzbpxt9bdWQEJkBXvL3zphCw2CHB9bfWvBhHiqtDoeSSi8ZdXk\nNTu13wKBgQDK3+qzz5+K58ihJ6TnwECdpsRHP17cW3sneQCHX4s8ejQGaRQWVS8E\n1CkNLROkSlbbIjhFbOUtK/xWuin4sWbT4dRLAJTig2abFxe8eJMLgHCHtEtVKEX0\nCjiH8wThp2WbTFdt+ZMQyHVyiRTnXuIBy/a87SLJGM/ns7daJG8jhw==\n-----END RSA PRIVATE KEY-----\n"} -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/DnsUnitTests.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System; 3 | using System.IO; 4 | using ACMESharp.DNS; 5 | 6 | namespace ACMESharp 7 | { 8 | [TestClass] 9 | public class DnsUnitTests 10 | { 11 | [TestMethod] 12 | public void TestUpdateDnsTxt() 13 | { 14 | var dnsInfo = DnsInfo.Load(File.ReadAllText("config\\dnsInfo.json")); 15 | 16 | dnsInfo.Provider.EditTxtRecord( 17 | $"_acme-challenge.foo1.{dnsInfo.DefaultDomain}", 18 | new string[] { $"{Environment.UserName}@{Environment.MachineName}@{DateTime.Now}" }); 19 | dnsInfo.Provider.EditTxtRecord( 20 | $"_acme-challenge.foo2.{dnsInfo.DefaultDomain}", 21 | new string[] { Environment.UserName, Environment.MachineName, DateTime.Now.ToString() }); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/OrderedIntegrationTests.playlist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Unit Tests for ACME Client for .NET")] 9 | [assembly: AssemblyDescription("Unit Tests for ACME protocol client library for the .NET platform.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("6d7be73b-b9e7-431a-93aa-c4956b7827c3")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/ce-key.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp-test/ce-key.der -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/ce-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | BwIAAACkAABSU0EyAAQAAAEAAQAPIKRd+JXbaBM/ZdmYwRs0m69s+4SRcs+WBPaP 3 | MItALmwph6r++qKFqswCtL6Y++UfEUqEBqldTl9ZpfwJDtlNbvtvBhpOEJRJ4Sh8 4 | 2VXBe+mTMvOryJ8P5JPiqHVIBDVU3as94KWUW309pApmPOoPylcByVkzyJM+LFuo 5 | ygvfjSnCauGTC8dzgCETr6O3bZGk3Jw3EiqAv/AtUQt+Yvs3JLmdZu3XxRfa+n3M 6 | 8yd9aSMJiUMjeKcmhsYeYjf3zcV3xyZWPo+Y7ZC4QwewaH3y6j1Rp2GQKv3kH9s3 7 | 7nHrVcK906Q4Aiz7LX5D5zM3eNSNJ+sud4sIf3QrB81RW5y3oZFEFwnPPWmveLd4 8 | 6Fgb0oWGGO9G9PDgUl9kWeDtu6SDoqa81Uyn3CmZwYaKucc1+pBOGRKm5874Fk9h 9 | ZHtjuAdEA/1UTNN+as2RQK+Eu8PXmOI0X8CNmAhIZdnbnuIWWWa/jjuoFQLdN5a1 10 | Q+P16gHxDTW/NVAFLv+mVmMMrwFXoKlso1sYKPHep+rApUtqfGVKeW+KLSdurP4C 11 | Q0IRIEuXhENh4+IKYHRLYN3gsKoUEf/kWNBBlXzQUo7GO+uQscEqGIocj6R/qPh3 12 | 4oqBeMGhBsyvCkN7+7Wub1A3rE7129ahaiW97y2BAk261ztvNE5YvjynSkTjlEOW 13 | 6HthgIOUr9nKs5C+JuejDyqxNlQYhXbBAn/u9Q7Ba4Xn1gq+JE6ocryEvs4Mfah8 14 | YtvLXNj7Ql+hC61t5APWBgdqKWw= 15 | -----END CERTIFICATE----- 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/dnsInfo.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp-test/config/dnsInfo.json.enc -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/dnsInfo.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "DefaultDomain": "sample.com", 3 | "Provider": { 4 | "$type": "ACMESharp.DNS.AwsRoute53DnsProvider, ACMESharp", 5 | "HostedZoneId": "Route53-Hosted-Zone-ID", 6 | "AccessKeyId": "IAM-Account-AccessKey", 7 | "SecretAccessKey": "IAM-Account-SecretKey", 8 | "Region": "us-east-1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/secure-dnsInfo.ps1: -------------------------------------------------------------------------------- 1 | 2 | $sfExec = "$PSScriptRoot\..\..\packages\secure-file.1.0.31\tools\secure-file.exe" 3 | $target = "$PSScriptRoot\dnsInfo.json" 4 | 5 | $cred = Get-Credential -Message "Specify the password to encrypt with (Username is ignored)." -UserName "IGNORED" 6 | 7 | if (-not $cred) { 8 | Write-Warning "Aborted." 9 | } 10 | 11 | & $sfExec -encrypt $target -secret $cred.GetNetworkCredential().Password 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/secure-testProxyConfig.ps1: -------------------------------------------------------------------------------- 1 | 2 | $sfExec = "$PSScriptRoot\..\..\packages\secure-file.1.0.31\tools\secure-file.exe" 3 | $target = "$PSScriptRoot\testProxyConfig.json" 4 | 5 | $cred = Get-Credential -Message "Specify the password to encrypt with (Username is ignored)." -UserName "IGNORED" 6 | 7 | if (-not $cred) { 8 | Write-Warning "Aborted." 9 | } 10 | 11 | & $sfExec -encrypt $target -secret $cred.GetNetworkCredential().Password 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/secure-webServerInfo.ps1: -------------------------------------------------------------------------------- 1 | 2 | $sfExec = "$PSScriptRoot\..\..\packages\secure-file.1.0.31\tools\secure-file.exe" 3 | $target = "$PSScriptRoot\webServerInfo.json" 4 | 5 | $cred = Get-Credential -Message "Specify the password to encrypt with (Username is ignored)." -UserName "IGNORED" 6 | 7 | if (-not $cred) { 8 | Write-Warning "Aborted." 9 | } 10 | 11 | & $sfExec -encrypt $target -secret $cred.GetNetworkCredential().Password 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/testProxyConfig.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp-test/config/testProxyConfig.json.enc -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/testProxyConfig.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | /* 3 | Use this file to toggle the use of a web proxy during unit 4 | test automation and configuring the proxy parameters. This 5 | can be used to support integrating a Web Proxy-based test 6 | support tool, such as Web Service mocking objects. 7 | */ 8 | "UseProxy": false, 9 | "HostName": "web-proxy-hostname", 10 | "HostPort": 8888, 11 | "AcceptAllServerCerts": true 12 | } 13 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/webServerInfo.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp-test/config/webServerInfo.json.enc -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/config/webServerInfo.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "Provider": { 3 | "$type": "ACMESharp.WebServer.AwsS3WebServerProvider, ACMESharp", 4 | "BucketName": "acmetesting.sample.com", 5 | "AccessKeyId": "IAM-Account-AccessKey", 6 | "SecretAccessKey": "IAM-Account-SecretKey", 7 | "Region": "us-east-1", 8 | "DnsProvider": { 9 | "$type": "ACMESharp.DNS.AwsRoute53DnsProvider, ACMESharp", 10 | "HostedZoneId": "Route53-Hosted-Zone-ID", 11 | "AccessKeyId": "IAM-Account-AccessKey", 12 | "SecretAccessKey": "IAM-Account-SecretKey", 13 | "Region": "us-east-1" 14 | }, 15 | "DnsCnameTarget": "star.acmetesting.sample.com" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp-test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.OpenSSL-test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp.OpenSSL-test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.OpenSSL-test")] 13 | [assembly: AssemblyCopyright("Copyright © 2016 Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7bc24d16-e849-406d-82e7-26c5e969c493")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.0.0.0")] 36 | [assembly: AssemblyFileVersion("0.0.0.0")] 37 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.BouncyCastle/BCPkiTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.Providers 8 | { 9 | public class BCPkiTool : BouncyCastleProvider, IPkiTool 10 | { 11 | public BCPkiTool(IReadOnlyDictionary newParams) 12 | : base(newParams) 13 | { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.BouncyCastle/BCPkiToolProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ACMESharp.Ext; 7 | 8 | namespace ACMESharp.PKI.Providers 9 | { 10 | [PkiToolProvider(BouncyCastleProvider.PROVIDER_NAME, 11 | Aliases = new[] { "BC" }, 12 | Label = "Bouncy Castle PKI Tool", 13 | Description = "PKI Tooling implemented using the Bouncy Castle library.")] 14 | public class BCPkiToolProvider : IPkiToolProvider 15 | { 16 | public IEnumerable DescribeParameters() 17 | { 18 | return new ParameterDetail[0]; 19 | } 20 | 21 | public IPkiTool GetPkiTool(IReadOnlyDictionary initParams) 22 | { 23 | var kvPairs = initParams.Select(_ => 24 | new KeyValuePair(_.Key, _.Value.ToString())); 25 | var newParams = kvPairs.ToDictionary( 26 | _ => _.Key, 27 | _ => _.Value); 28 | return new BCPkiTool(newParams); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.BouncyCastle/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp.PKI.Providers.BouncyCastle")] 9 | [assembly: AssemblyDescription("CertificateProvider for ACMESharp using Bouncy Castle")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("473bff7d-c7f0-471d-b7a3-19ad9adfdba9")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.BouncyCastle/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/OSSLCliPkiTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.Providers 8 | { 9 | public class OSSLCliPkiTool : OpenSslCliProvider, IPkiTool 10 | { 11 | public OSSLCliPkiTool(IReadOnlyDictionary initParams) 12 | : base(initParams) 13 | { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/OSSLCliPkiToolProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ACMESharp.Ext; 7 | 8 | namespace ACMESharp.PKI.Providers 9 | { 10 | [PkiToolProvider(OpenSslCliProvider.PROVIDER_NAME, 11 | Label = "OpenSSL CLI", 12 | Description = "Provider for a PKI Tool that uses process calls" 13 | + " out to the command-line interface (CLI) OpenSSL" 14 | + " executable (openssl.exe).")] 15 | public class OSSLCliPkiToolProvider : IPkiToolProvider 16 | { 17 | public IEnumerable DescribeParameters() 18 | { 19 | return new ParameterDetail[0]; 20 | } 21 | 22 | public IPkiTool GetPkiTool(IReadOnlyDictionary initParams) 23 | { 24 | var kvPairs = initParams.Select(_ => 25 | new KeyValuePair(_.Key, _.Value.ToString())); 26 | var newParams = kvPairs.ToDictionary( 27 | _ => _.Key, 28 | _ => _.Value); 29 | return new OSSLCliPkiTool(newParams); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/OpenSslCliProvider_Config.txt: -------------------------------------------------------------------------------- 1 | ##################################################################### 2 | ## WARNING: WHEN SAVING THIS FILE BE SURE TO SAVE IT WITHOUT THE 3 | ## UTF-8 BOM LEADING CHARACTERS. 4 | ## OPENSSL DOES NOT SUPPORT READING THE BOM AND YOU WILL 5 | ## ENCOUNTER THIS SOMEWHAT CRYPTIC ERROR: 6 | ## DEF_LOAD_BIO:missing equal sign 7 | ##################################################################### 8 | 9 | [ req ] 10 | 11 | ## If set to the value no this disables prompting of certificate fields and just takes values 12 | ## from the config file directly. It also changes the expected format of the distinguished_name 13 | ## and attributes sections. 14 | prompt = no 15 | 16 | ## This specifies the section containing the distinguished name fields to prompt for when 17 | ## generating a certificate or certificate request. The format is described in the next section. 18 | distinguished_name = req_dn 19 | 20 | [ req_dn ] 21 | 22 | ## Sample: 23 | ## ------------ 24 | C = US 25 | ST = Maryland 26 | L = Crofton 27 | O = LetsEncrypt 28 | OU = Windows Technologies 29 | CN = test1.acmetest.letsencrypt.org 30 | emailAddress = test@mailinator.com 31 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp PKI Providers - OpenSslCli")] 9 | [assembly: AssemblyDescription("CertificateProvider for ACMESharp using OpenSSL CLI")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("5b454575-9688-4a54-bc2b-2d18a15e452b")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/4758cca.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/4758cca.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/aep.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/aep.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/atalla.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/atalla.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/capi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/capi.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/chil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/chil.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/cswift.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/cswift.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/gmp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/gmp.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/gost.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/gost.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/libeay32.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/msvcr120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/msvcr120.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/nuron.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/nuron.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/openssl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/openssl.exe -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/padlock.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/padlock.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/ssleay32.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/sureware.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/sureware.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/ubsec.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.PKI.Providers.OpenSslCli/openssl-win32-bin/ubsec.dll -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib/OSSLLibPkiTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.Providers 8 | { 9 | public class OSSLLibPkiTool : OpenSslLibProvider, IPkiTool 10 | { 11 | public OSSLLibPkiTool(IReadOnlyDictionary initParams) 12 | : base(initParams) 13 | { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib/OSSLLibPkiToolProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ACMESharp.Ext; 7 | 8 | namespace ACMESharp.PKI.Providers 9 | { 10 | [PkiToolProvider(OpenSslLibProvider.PROVIDER_NAME, 11 | Label = "OpenSSL Library", 12 | Description = "Provider for a PKI Tool that is based on the .NET" 13 | + " port of OpenSSL library; you must also include at" 14 | + " least one of the x86 or x64 companion libraries" 15 | + " depending on your execution environment.")] 16 | public class OSSLLibPkiToolProvider : IPkiToolProvider 17 | { 18 | public IEnumerable DescribeParameters() 19 | { 20 | return new ParameterDetail[0]; 21 | } 22 | 23 | public IPkiTool GetPkiTool(IReadOnlyDictionary initParams) 24 | { 25 | var kvPairs = initParams.Select(_ => 26 | new KeyValuePair(_.Key, _.Value.ToString())); 27 | var newParams = kvPairs.ToDictionary( 28 | _ => _.Key, 29 | _ => _.Value); 30 | return new OSSLLibPkiTool(newParams); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp PKI Providers - OpenSslLib")] 9 | [assembly: AssemblyDescription("CertificateProvider for ACMESharp using OpenSSL Win Lib - x86/x64")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("86961a92-474a-4c0c-9a7d-f6edd57efd56")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib32/ACMESharp.PKI.Providers.OpenSslLib32.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://raw.githubusercontent.com/ebekker/ACMESharp/rename-le-win-to-acmesharp/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Initial nuget package early-access release of nuget package. 16 | Copyright © 2015 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt 18 | 19 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib32/OpenSslLib32Provider.cs: -------------------------------------------------------------------------------- 1 | using OpenSSL.Core; 2 | using OpenSSL.Crypto; 3 | using OpenSSL.X509; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace ACMESharp.PKI.Providers 11 | { 12 | public class OpenSslLib32Provider : OpenSslLibBaseProvider 13 | { 14 | public OpenSslLib32Provider(IReadOnlyDictionary initParams) 15 | : base(initParams) 16 | { } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib32/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp PKI Providers - OpenSslLib32")] 9 | [assembly: AssemblyDescription("CertificateProvider for ACMESharp using OpenSSL WinLib32")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("2ce2e059-f228-4f88-8440-0413c1af2e4c")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib32/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib64/ACMESharp.PKI.Providers.OpenSslLib64.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://raw.githubusercontent.com/ebekker/ACMESharp/rename-le-win-to-acmesharp/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Initial nuget package early-access release of nuget package. 16 | Copyright © 2015 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt 18 | 19 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib64/OpenSslLib64Provider.cs: -------------------------------------------------------------------------------- 1 | using OpenSSL.Core; 2 | using OpenSSL.Crypto; 3 | using OpenSSL.X509; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace ACMESharp.PKI.Providers 11 | { 12 | public class OpenSslLib64Provider : OpenSslLibBaseProvider 13 | { 14 | public OpenSslLib64Provider(IReadOnlyDictionary initParams) 15 | : base(initParams) 16 | { } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib64/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp PKI Providers - OpenSslLib64")] 9 | [assembly: AssemblyDescription("CertificateProvider for ACMESharp using OpenSSL WinLib64")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("98b532b3-805b-4d81-918e-5a76cc66d40d")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.PKI.Providers.OpenSslLib64/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/Pester/000-Common.ps1: -------------------------------------------------------------------------------- 1 |  2 | Set-StrictMode -Version Latest 3 | 4 | if (-not $env:PESTER_PSVER) { 5 | $env:PESTER_PSVER = $PSVersionTable.PSVersion.Major 6 | } 7 | 8 | $TEST_DNS_ID = "acme-pester.acmetesting.zyborg.io" 9 | $TEST_MYIP_DNS_ID = "acme-pester-ps$($env:PESTER_PSVER)-myip.acmetesting.zyborg.io" 10 | $TEST_DNS_CHLNG_ID = "acme-pester-ps$($env:PESTER_PSVER)-chlng.acmetesting.zyborg.io" 11 | 12 | 13 | if (-not (Get-Variable ACME_POSH_PATH -ValueOnly -ErrorAction Ignore)) { 14 | $ACME_POSH_PATH = "$PSScriptRoot\..\bin\ACMESharp" 15 | } 16 | Write-Host "Resolve ACMESharp POSH Module path to [$ACME_POSH_PATH]" 17 | ipmo $ACME_POSH_PATH 18 | 19 | 20 | function Test-IsAdmin { 21 | ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole( 22 | [Security.Principal.WindowsBuiltInRole] "Administrator") 23 | } 24 | 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp.POSH-test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.POSH-test")] 13 | [assembly: AssemblyCopyright("Copyright © Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b3a8ddd2-527e-4a65-aa57-127f2a2d6276")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.0.0.0")] 36 | [assembly: AssemblyFileVersion("0.0.0.0")] 37 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/README-PESTER.txt: -------------------------------------------------------------------------------- 1 |  2 | PS> ipmo pester 3 | PS> Get-Help about_Pester 4 | 5 | PS> New-Fixture pathToTest Function 6 | 7 | Creates two files: 8 | ./pathToTest/Clean.ps1 9 | ./pathToTest/Clean.Tests.ps1 10 | 11 | PS> Invoke-Pester 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/choco/acmesharp-posh-all/choco-pack.cmd: -------------------------------------------------------------------------------- 1 | @SETLOCAL 2 | @SET THIS_DIR=%~dp0 3 | @SET NUSPEC=%THIS_DIR%acmesharp-posh-all.nuspec 4 | @ECHO Packing Choco Nuspec %NUSPEC% 5 | @PUSHD %THIS_DIR% 6 | choco pack %NUSPEC% 7 | @POPD 8 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/choco/acmesharp-posh-all/choco-test-install.cmd: -------------------------------------------------------------------------------- 1 | choco install acmesharp-posh-all -fdv -s . -pre 2 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/choco/acmesharp-posh-all/choco-test-uninstall.cmd: -------------------------------------------------------------------------------- 1 | choco uninstall acmesharp-posh-all -fdv 2 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/choco/acmesharp-posh-all/tools/chocolateyinstall.ps1: -------------------------------------------------------------------------------- 1 |  2 | $ErrorActionPreference = 'Stop'; # stop on all errors 3 | 4 | $packageName = 'acmesharp-posh-all' # arbitrary name for the package, used in messages 5 | $poshModuleName = 'ACMESharp' 6 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 7 | $sourceDir = "$(Split-Path -parent $toolsDir)\source" 8 | 9 | $isAdmin = Test-ProcessAdminRights 10 | $psCurVer = $PSVersionTable.PSVersion.Major 11 | $psMinVer = 3 12 | 13 | if ($psCurVer -lt $psMinVer) { 14 | throw "Minimum PS version required is $psMinVer; $current PS version detected is $psCurVer" 15 | } 16 | 17 | $localInstallPathSave = "$($env:LOCALAPPDATA)\acmesharp-installpath.txt" 18 | $globalInstallPathSave = "$toolsDir\acmesharp-installpath.txt" 19 | 20 | $installPathSave = if ($isAdmin) { $globalInstallPathSave } else { $localInstallPathSave } 21 | 22 | ipmo PsGet 23 | 24 | $installModuleParams = @{ 25 | Global = $isAdmin 26 | ModulePath = "$sourceDir\$poshModuleName" 27 | } 28 | 29 | Install-Module @installModuleParams 30 | 31 | ## Once we install the module, try to load it and see where it 32 | ## is installed to so that we can remember for uninstallation 33 | $modInfo = Get-Module $poshModuleName 34 | if (-not $modInfo) { 35 | ipmo $poshModuleName 36 | $modInfo = Get-Module $poshModuleName 37 | } 38 | if (-not $modInfo) { 39 | Write-Warning "Unable to resolve the [$poshModuleName] module details" 40 | } 41 | else { 42 | $installPath = $modInfo.ModuleBase 43 | if ($installPath) { 44 | [System.IO.File]::WriteAllText($installPathSave, $installPath) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/choco/acmesharp-posh-all/tools/chocolateyuninstall.ps1: -------------------------------------------------------------------------------- 1 |  2 | $ErrorActionPreference = 'Stop'; # stop on all errors 3 | 4 | $packageName = 'acmesharp-posh-all' 5 | $poshModuleName = 'ACMESharp' 6 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 7 | 8 | $isAdmin = Test-ProcessAdminRights 9 | 10 | $localInstallPathSave = "$($env:LOCALAPPDATA)\acmesharp-installpath.txt" 11 | $globalInstallPathSave = "$toolsDir\acmesharp-installpath.txt" 12 | 13 | if (-not (Test-Path $localInstallPathSave -PathType Leaf) -and 14 | -not (Test-Path $globalInstallPathSave -PathType Leaf)) { 15 | Write-Warning "Could not find module in either LOCAL or GLOBAL modules path" 16 | return 17 | } 18 | 19 | if (Test-Path $localInstallPathSave) { 20 | $installPath = [System.IO.File]::ReadAllText($localInstallPathSave) 21 | if (Test-Path $installPath) { 22 | Write-Warning "Removing LOCAL PS Module directory at [$installPath]" 23 | rd $installPath -Recurse 24 | del $localInstallPathSave 25 | } 26 | else { 27 | Write-Warning "PS Module was expected at LOCAL [$installPath] but was not found" 28 | } 29 | } 30 | 31 | if (Test-Path $globalInstallPathSave) { 32 | $installPath = [System.IO.File]::ReadAllText($globalInstallPathSave) 33 | if (Test-Path $installPath) { 34 | Write-Warning "Removing GLOBAL PS Module directory at [$installPath]" 35 | 36 | if (-not $isAdmin) { 37 | Write-Warning "Attempting to remove from GLOBAL as non-Admin; this may fail..." 38 | } 39 | 40 | rd $installPath -Recurse 41 | del $globalInstallPathSave 42 | } 43 | else { 44 | Write-Warning "PS Module was expected at GLOBAL [$installPath] but was not found" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH-test/choco/test.ps1: -------------------------------------------------------------------------------- 1 |  2 | 3 | dir "C:\ProgramData\chocolatey\lib" 4 | 5 | dir "C:\Program Files\WindowsPowerShell\Modules" 6 | dir "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules" 7 | 8 | ## rd -Recurse "C:\Program Files\WindowsPowerShell\Modules\ACMESharp" 9 | ## rd -Recurse "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules\ACMESharp" -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/ACMESharp-AWS/ACMESharp-AWS.psd1: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | RootModule = 'ACMESharp-AWS' 4 | ModuleVersion = '0.1.0' 5 | GUID = '245AF7C8-E8FA-4510-B7B4-BA30F5FF423B' 6 | DefaultCommandPrefix = 'ACME' 7 | } 8 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/ACMESharp-IIS/ACMESharp-IIS.psd1: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | RootModule = 'ACMESharp-IIS' 4 | ModuleVersion = '0.1.0' 5 | GUID = '245AF7C8-E8FA-4510-B7B4-BA30F5FF423B' 6 | DefaultCommandPrefix = 'ACME' 7 | } 8 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/ACMESharp.POSH.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp PowerShell Module main library. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt powershell acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/GetRegistration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Management.Automation; 3 | 4 | namespace ACMESharp.POSH 5 | { 6 | [Cmdlet(VerbsCommon.Get, "Registration")] 7 | [OutputType(typeof(AcmeRegistration))] 8 | public class GetRegistration : AcmeCmdlet 9 | { 10 | [Parameter] 11 | public string VaultProfile 12 | { get; set; } 13 | 14 | protected override void ProcessRecord() 15 | { 16 | using (var vlt = Util.VaultHelper.GetVault(VaultProfile)) 17 | { 18 | vlt.OpenStorage(); 19 | var v = vlt.LoadVault(); 20 | 21 | if (v.Registrations == null || v.Registrations.Count < 1) 22 | throw new InvalidOperationException("No registrations found"); 23 | 24 | var ri = v.Registrations[0]; 25 | var r = ri.Registration; 26 | 27 | WriteObject(r); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/GetVault.cs: -------------------------------------------------------------------------------- 1 | using System.Management.Automation; 2 | 3 | namespace ACMESharp.POSH 4 | { 5 | [Cmdlet(VerbsCommon.Get, "Vault")] 6 | [OutputType(typeof(Vault.Model.VaultInfo))] 7 | public class GetVault : AcmeCmdlet 8 | { 9 | [Parameter] 10 | public string VaultProfile 11 | { get; set; } 12 | 13 | protected override void ProcessRecord() 14 | { 15 | using (var vlt = Util.VaultHelper.GetVault(VaultProfile)) 16 | { 17 | if (!vlt.TestStorage()) 18 | { 19 | WriteObject(null); 20 | } 21 | else 22 | { 23 | vlt.OpenStorage(); 24 | WriteObject(vlt.LoadVault(true)); 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/GetVaultProfile.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Vault; 2 | using ACMESharp.Vault.Profile; 3 | using System.Management.Automation; 4 | 5 | namespace ACMESharp.POSH 6 | { 7 | [Cmdlet(VerbsCommon.Get, "VaultProfile", DefaultParameterSetName = PSET_LIST)] 8 | [OutputType(typeof(VaultProfile), ParameterSetName = new string[] { PSET_GET })] 9 | public class GetVaultProfile : AcmeCmdlet 10 | { 11 | public const string PSET_LIST = "List"; 12 | public const string PSET_GET = "Get"; 13 | public const string PSET_RELOAD_PROVIDERS = "ReloadProviders"; 14 | 15 | [Parameter(ParameterSetName = PSET_LIST)] 16 | public SwitchParameter ListProfiles 17 | { get; set; } 18 | 19 | [Parameter(ParameterSetName = PSET_GET, Position = 0)] 20 | public string ProfileName 21 | { get; set; } 22 | 23 | [Parameter(ParameterSetName = PSET_RELOAD_PROVIDERS)] 24 | public SwitchParameter ReloadProviders 25 | { get; set; } 26 | 27 | protected override void ProcessRecord() 28 | { 29 | if (ReloadProviders) 30 | { 31 | VaultExtManager.Reload(); 32 | } 33 | else if (ListProfiles) 34 | { 35 | WriteObject(VaultProfileManager.GetProfileNames(), true); 36 | } 37 | else 38 | { 39 | var profileName = VaultProfileManager.ResolveProfileName(ProfileName); 40 | WriteObject(VaultProfileManager.GetProfile(profileName)); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/NLog.config.sample: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 14 | 18 | 19 | 20 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp PowerShell Main Module")] 9 | [assembly: AssemblyDescription("PowerShell Module library for ACMESharp POSH Module client.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("2f8d5934-b5a7-4983-8051-1f25882c7c30")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/README-TESTING.txt: -------------------------------------------------------------------------------- 1 | An easy way to test this POSH module project, which generates an assembly DLL, 2 | is to configure the local project's "Debug" settings to use the following: 3 | 4 | * Make sure to create a "TestVault" folder in the generated "bin" sub-directory 5 | 6 | * Start Actions > Start External Program (note this is 32-bit PS, see #2 below): 7 | C:\windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe 8 | 9 | * Start Options > Command line arguments (note the exec policy, see #3 below): 10 | -NoExit -Command "Set-ExecutionPolicy -Force -Scope Process -ExecutionPolicy RemoteSigned;ipmo @('..\Debug\ACMESharp', '..\Debug\ACMESharp\ACMESharp-AWS', '..\Debug\ACMESharp\ACMESharp-IIS')" 11 | * Start Options > Working directory: 12 | ..\..\TestVault 13 | 14 | NOTES: 15 | 16 | (1) IGNORE Any warnings that come up about "missing paths" 17 | for the Working Directory -- the VS UI doesn't resolve 18 | relative paths, but the build process will (VS2015). 19 | 20 | (2) Up above we invoke the 32-bit PS shell because of current limitation 21 | on the ManagedOpenSSL Nuget package and that it only delivers 32-bit 22 | versions of the native OpenSSL libraries. This will be remedied in 23 | a future update of the ManagedOpenSSL Nuget package. 24 | 25 | (3) We issue the ExecutionPolicy command with launching the PS shell 26 | because the "Installers" modules are written as Script Modules; 27 | if the default POSH Exec Policy on the local host is at least as 28 | permissive as "RemoteSigned", then this step can be skipped. 29 | 30 | Also, in the .user build configuration file where the Debug settings 31 | are stored, you can substitute references to the "Debug" component 32 | of any path with $(Configuration) to make it work correctly across 33 | any build configuration -- note this has to be done in the file 34 | directly, as the UI will escape the non-alpha chars. Reload the 35 | project if you make any changes to the build config files directly. 36 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/Util/PkiHelper.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.PKI; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.POSH.Util 9 | { 10 | public static class PkiHelper 11 | { 12 | public static IPkiTool GetPkiTool(string name) 13 | { 14 | return string.IsNullOrEmpty(name) 15 | //? CertificateProvider.GetProvider() 16 | //: CertificateProvider.GetProvider(name); 17 | ? PkiToolExtManager.GetPkiTool() 18 | : PkiToolExtManager.GetPkiTool(name); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/Util/VaultHelper.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | using ACMESharp.Util; 3 | using ACMESharp.Vault; 4 | using ACMESharp.Vault.Profile; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace ACMESharp.POSH.Util 13 | { 14 | public static class VaultHelper 15 | { 16 | static VaultHelper() 17 | { 18 | PoshHelper.BeforeExtAccess(); 19 | } 20 | 21 | public static IVault GetVault(string profileName = null) 22 | { 23 | profileName = VaultProfileManager.ResolveProfileName(profileName); 24 | if (string.IsNullOrEmpty(profileName)) 25 | throw new InvalidOperationException("unable to resolve effective profile name"); 26 | 27 | var profile = VaultProfileManager.GetProfile(profileName); 28 | if (profile == null) 29 | throw new InvalidOperationException("unable to resolve effective profile") 30 | .With(nameof(profileName), profileName); 31 | 32 | var provider = VaultExtManager.GetProvider(profile.ProviderName, null); 33 | if (provider == null) 34 | throw new InvalidOperationException("unable to resolve Vault Provider") 35 | .With(nameof(profileName), profileName) 36 | .With(nameof(profile.ProviderName), profile.ProviderName); 37 | 38 | return provider.GetVault(profile.VaultParameters); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/choco/acmesharp-posh/choco-pack.cmd: -------------------------------------------------------------------------------- 1 | @SETLOCAL 2 | @SET THIS_DIR=%~dp0 3 | @SET NUSPEC=%THIS_DIR%acmesharp-posh-ea.nuspec 4 | @ECHO Packing Choco Nuspec %NUSPEC% 5 | @PUSHD %THIS_DIR% 6 | choco pack %NUSPEC% 7 | @POPD 8 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/choco/acmesharp-posh/choco-test-install.cmd: -------------------------------------------------------------------------------- 1 | choco install acmesharp-posh-ea -fdv -s . -pre 2 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/choco/acmesharp-posh/choco-test-uninstall.cmd: -------------------------------------------------------------------------------- 1 | choco uninstall acmesharp-posh-ea -fdv 2 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/choco/acmesharp-posh/tools/chocolateyinstall.ps1: -------------------------------------------------------------------------------- 1 |  2 | $ErrorActionPreference = 'Stop'; # stop on all errors 3 | 4 | $packageName = 'acmesharp-posh' # arbitrary name for the package, used in messages 5 | $poshModuleName = 'ACMESharp' 6 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 7 | $sourceDir = "$(Split-Path -parent $toolsDir)\source" 8 | 9 | $isAdmin = Test-ProcessAdminRights 10 | 11 | $localInstallPathSave = "$($env:LOCALAPPDATA)\acmesharp-installpath.txt" 12 | $globalInstallPathSave = "$toolsDir\acmesharp-installpath.txt" 13 | 14 | $installPathSave = if ($isAdmin) { $globalInstallPathSave } else { $localInstallPathSave } 15 | 16 | ipmo PsGet 17 | 18 | $installModuleParams = @{ 19 | Global = $isAdmin 20 | ModulePath = "$sourceDir\$poshModuleName" 21 | } 22 | 23 | Install-Module @installModuleParams 24 | 25 | ## Once we install the module, try to load it and see where it 26 | ## is installed to so that we can remember for uninstallation 27 | $modInfo = Get-Module $poshModuleName 28 | if (-not $modInfo) { 29 | ipmo $poshModuleName 30 | $modInfo = Get-Module $poshModuleName 31 | } 32 | if (-not $modInfo) { 33 | Write-Warning "Unable to resolve the [$poshModuleName] module details" 34 | } 35 | else { 36 | $installPath = $modInfo.ModuleBase 37 | if ($installPath) { 38 | [System.IO.File]::WriteAllText($installPathSave, $installPath) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/choco/acmesharp-posh/tools/chocolateyuninstall.ps1: -------------------------------------------------------------------------------- 1 |  2 | $ErrorActionPreference = 'Stop'; # stop on all errors 3 | 4 | $packageName = 'acmesharp-posh' 5 | $poshModuleName = 'ACMESharp' 6 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 7 | 8 | $isAdmin = Test-ProcessAdminRights 9 | 10 | $localInstallPathSave = "$($env:LOCALAPPDATA)\acmesharp-installpath.txt" 11 | $globalInstallPathSave = "$toolsDir\acmesharp-installpath.txt" 12 | 13 | $installPathSave = if ($isAdmin) { $globalInstallPathSave } else { $localInstallPathSave } 14 | 15 | if (Test-Path $installPathSave) { 16 | $installPath = [System.IO.File]::ReadAllText($installPathSave) 17 | } 18 | else { 19 | throw "Unable to resolve module installation path" 20 | } 21 | 22 | if (Test-Path $installPath) { 23 | Write-Warning "Removing PS Module directory at [$installPath]" 24 | rd $installPath -Recurse 25 | del $installPathSave 26 | } 27 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/choco/test.ps1: -------------------------------------------------------------------------------- 1 |  2 | 3 | dir "C:\ProgramData\chocolatey\lib" 4 | 5 | dir "C:\Program Files\WindowsPowerShell\Modules" 6 | dir "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules" 7 | 8 | ## rd -Recurse "C:\Program Files\WindowsPowerShell\Modules\ACMESharp" 9 | ## rd -Recurse "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules\ACMESharp" -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/en-US/ACMESharp.POSH.dll-Help.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/en-US/about_ACMESharp.help.txt: -------------------------------------------------------------------------------- 1 | TOPIC 2 | about_ACMESharp 3 | 4 | SHORT DESCRIPTION 5 | 6 | LONG DESCRIPTION 7 | 8 | EXAMPLES 9 | 10 | KEYWORDS 11 | acme 12 | 13 | SEE ALSO 14 | about_LetsEncrypt 15 | Let's Encrypt Project Home Page - https://letsencrypt.org/ 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/en-US/about_LetsEncrypt.help.txt: -------------------------------------------------------------------------------- 1 | TOPIC 2 | about_LetsEncrypt 3 | 4 | SHORT DESCRIPTION 5 | Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. Let’s Encrypt is a service provided by the Internet Security Research Group (ISRG). 6 | 7 | LONG DESCRIPTION 8 | Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. Let’s Encrypt is a service provided by the Internet Security Research Group (ISRG). 9 | 10 | The key principles behind Let’s Encrypt are: 11 | * Free: Anyone who owns a domain name can use Let’s Encrypt to obtain a trusted certificate at zero cost. 12 | * Automatic: Software running on a web server can interact with Let’s Encrypt to painlessly obtain a certificate, securely configure it for use, and automatically take care of renewal. 13 | * Secure: Let’s Encrypt will serve as a platform for advancing TLS security best practices, both on the CA side and by helping site operators properly secure their servers. 14 | * Transparent: All certificates issued or revoked will be publicly recorded and available for anyone to inspect. 15 | * Open: The automatic issuance and renewal protocol will be published as an open standard that others can adopt. 16 | * Cooperative: Much like the underlying Internet protocols themselves, Let’s Encrypt is a joint effort to benefit the community, beyond the control of any one organization. 17 | 18 | KEYWORDS 19 | letsencrypt acme 20 | 21 | SEE ALSO 22 | about_ACMESharp 23 | Let's Encrypt Project Home Page - https://letsencrypt.org/ 24 | Internet Security Research Group (ISRG) - https://letsencrypt.org/isrg/ 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.POSH/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/AwsR53HandlerParams.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Providers.Config; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Providers.AWS.Config 9 | { 10 | public class AwsR53HandlerParams : BaseParams 11 | { 12 | [Obsolete] 13 | public string DefaultDomain 14 | { 15 | get { return (string)this[nameof(DefaultDomain)]; } 16 | } 17 | 18 | public string HostedZoneId 19 | { 20 | get { return Get(AwsRoute53ChallengeHandlerProvider.HOSTED_ZONE_ID.Name); } 21 | set { this[AwsRoute53ChallengeHandlerProvider.HOSTED_ZONE_ID.Name] = value; } 22 | } 23 | 24 | public string AccessKeyId 25 | { 26 | get { return Get(AwsCommonParams.ACCESS_KEY_ID.Name); } 27 | set { this[AwsCommonParams.ACCESS_KEY_ID.Name] = value; } 28 | } 29 | 30 | public string SecretAccessKey 31 | { 32 | get { return Get(AwsCommonParams.SECRET_ACCESS_KEY.Name); } 33 | set { this[AwsCommonParams.SECRET_ACCESS_KEY.Name] = value; } 34 | } 35 | 36 | public string Region 37 | { 38 | get { return Get(AwsCommonParams.REGION.Name); } 39 | set { this[AwsCommonParams.REGION.Name] = value; } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/AwsR53HandlerParams.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.Providers-test/Config/AwsR53HandlerParams.json.enc -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/AwsR53HandlerParams.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "DefaultDomain": "sample.com", 3 | "HostedZoneId": "Route53-Hosted-Zone-ID", 4 | "AwsAccessKeyId": "IAM-Account-AccessKey", 5 | "AwsSecretAccessKey": "IAM-Account-SecretKey", 6 | "AwsRegion": "us-east-1" 7 | } 8 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/AwsS3HandlerParams.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Providers.Config; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Providers.AWS.Config 9 | { 10 | public class AwsS3HandlerParams : BaseParams 11 | { 12 | public string BucketName 13 | { 14 | get { return Get(AwsS3ChallengeHandlerProvider.BUCKET_NAME.Name); } 15 | } 16 | 17 | public string ContentType 18 | { 19 | get { return Get(AwsS3ChallengeHandlerProvider.CONTENT_TYPE.Name); } 20 | } 21 | 22 | public string CannedAcl 23 | { 24 | get { return Get(AwsS3ChallengeHandlerProvider.CANNED_ACL.Name); } 25 | } 26 | 27 | public string AccessKeyId 28 | { 29 | get { return Get(AwsCommonParams.ACCESS_KEY_ID.Name); } 30 | set { this[AwsCommonParams.ACCESS_KEY_ID.Name] = value; } 31 | } 32 | 33 | public string SecretAccessKey 34 | { 35 | get { return Get(AwsCommonParams.SECRET_ACCESS_KEY.Name); } 36 | set { this[AwsCommonParams.SECRET_ACCESS_KEY.Name] = value; } 37 | } 38 | 39 | public string Region 40 | { 41 | get { return Get(AwsCommonParams.REGION.Name); } 42 | set { this[AwsCommonParams.REGION.Name] = value; } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/AwsS3HandlerParams.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.Providers-test/Config/AwsS3HandlerParams.json.enc -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/AwsS3HandlerParams.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "BucketName": "acmetesting.sample.com", 3 | "ContentType": "acmetesting.sample.com", 4 | "CannedAcl": "acmetesting.sample.com", 5 | "AwsAccessKeyId": "IAM-Account-AccessKey", 6 | "AwsSecretAccessKey": "IAM-Account-SecretKey", 7 | "AwsRegion": "us-east-1" 8 | } 9 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/BaseParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Providers.Config 8 | { 9 | public class BaseParams : Dictionary 10 | { 11 | protected T Get(string key) 12 | { 13 | if (ContainsKey(key)) 14 | return (T)this[key]; 15 | else 16 | return default(T); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/CloudFlareHandlerParams.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/ACMESharp/ACMESharp.Providers-test/Config/CloudFlareHandlerParams.json.enc -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/CloudFlareHandlerParams.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "EmailAddress": "", 3 | "DomainName": "", 4 | "AuthKey": "" 5 | } 6 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/IisHandlerParams.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Providers.Config; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Providers.IIS.Config 9 | { 10 | public class IisHandlerParams : BaseParams 11 | { 12 | public string WebSiteRef 13 | { 14 | get { return Get(IisChallengeHandlerProvider.WEB_SITE_REF.Name); } 15 | set { this[IisChallengeHandlerProvider.WEB_SITE_REF.Name] = value; } 16 | } 17 | 18 | public bool SkipLocalWebConfig 19 | { 20 | get { return Get(IIS.IisChallengeHandlerProvider.SKIP_LOCAL_WEB_CONFIG.Name); } 21 | set { this[IisChallengeHandlerProvider.SKIP_LOCAL_WEB_CONFIG.Name] = value; } 22 | } 23 | 24 | public string OverrideSiteRoot 25 | { 26 | get { return Get(IIS.IisChallengeHandlerProvider.OVERRIDE_SITE_ROOT.Name); } 27 | set { this[IisChallengeHandlerProvider.OVERRIDE_SITE_ROOT.Name] = value; } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/secure-AllParamsJson.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [switch]$Decrypt, 3 | [string]$Secret 4 | ) 5 | 6 | if ($Decrypt) { 7 | & "$PSScriptRoot\secure-files.ps1" -Secret $Secret -Targets "$PSScriptRoot\*Params.json.enc" -Decrypt 8 | } 9 | else { 10 | & "$PSScriptRoot\secure-files.ps1" -Secret $Secret -Targets "$PSScriptRoot\*Params.json" 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Config/secure-files.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [Parameter(Mandatory)] 3 | [string[]]$Targets, 4 | 5 | [switch]$Decrypt, 6 | [string]$Secret 7 | ) 8 | 9 | $sfExec = "$PSScriptRoot\..\..\packages\secure-file.1.0.31\tools\secure-file.exe" 10 | 11 | if (-not $Secret) { 12 | $cred = Get-Credential -Message "Specify the password to encrypt with (Username is ignored)." -UserName "IGNORED" 13 | $Secret = $cred.GetNetworkCredential().Password 14 | } 15 | 16 | if (-not $Secret) { 17 | Write-Warning "No Secret resolved. Aborted." 18 | } 19 | 20 | foreach ($t in (Get-ChildItem $Targets)) { 21 | if ($Decrypt) { 22 | Write-Output "Decrypting [$t]" 23 | & $sfExec -decrypt $t -secret $Secret 24 | } 25 | else { 26 | Write-Output "Encrypting [$t]" 27 | & $sfExec -encrypt $t -secret $Secret 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp.Providers-test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Providers-test")] 13 | [assembly: AssemblyCopyright("Copyright © Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("46933e79-e139-45a0-a321-5efa7fec3ee9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.0.0.0")] 36 | [assembly: AssemblyFileVersion("0.0.0.0")] 37 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/TestCommon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ACMESharp.ACME; 7 | 8 | namespace ACMESharp.Providers 9 | { 10 | static class TestCommon 11 | { 12 | public static readonly Challenge DNS_CHALLENGE = new DnsChallenge("", new DnsChallengeAnswer()); 13 | public static readonly Challenge HTTP_CHALLENGE = new HttpChallenge("", new HttpChallengeAnswer()); 14 | public static readonly Challenge TLS_SNI_CHALLENGE = new TlsSniChallenge("", new TlsSniChallengeAnswer()); 15 | public static readonly Challenge FAKE_CHALLENGE = new FakeChallenge(new FakeChallengeAnswer()); 16 | 17 | class FakeChallengeAnswer : ChallengeAnswer 18 | { 19 | 20 | } 21 | 22 | class FakeChallenge : Challenge 23 | { 24 | public FakeChallenge(ChallengeAnswer answer) 25 | : base(ChallengeTypeKind.OTHER, "", answer) 26 | { } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers-test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.AWS/ACMESharp.Providers.AWS.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Provider Lib for AWS (S3, CloudFront). 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.AWS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp AWS Provider")] 9 | [assembly: AssemblyDescription("AWS Provider extension for ACMESharp")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Providers.AWS")] 13 | [assembly: AssemblyCopyright("Copyright © " + ASMINFO.COPYRIGHT_YEAR + " Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cd8842f7-5cbd-4db1-b2b9-387a095ab91f")] 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.AWS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/ACMESharp.Providers.CloudFlare.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Provider Lib for CloudFlare. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/CloudFlareChallengeHandler.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.ACME; 2 | using System; 3 | using System.Text.RegularExpressions; 4 | 5 | namespace ACMESharp.Providers.CloudFlare 6 | { 7 | public class CloudFlareChallengeHandler : IChallengeHandler 8 | { 9 | public string AuthKey { get; set; } 10 | public string EmailAddress { get; set; } 11 | public string DomainName { get; set; } 12 | 13 | public void Handle(ChallengeHandlingContext ctx) 14 | { 15 | AssertNotDisposed(); 16 | DnsChallenge challenge = (DnsChallenge)ctx.Challenge; 17 | var helper = new CloudFlareHelper(AuthKey, EmailAddress, DomainName); 18 | helper.AddOrUpdateDnsRecord(challenge.RecordName, GetCleanedRecordValue(challenge.RecordValue)); 19 | 20 | ctx.Out.WriteLine("DNS record created of type [TXT] with name [{0}]", challenge.RecordName); 21 | } 22 | 23 | public void CleanUp(ChallengeHandlingContext ctx) 24 | { 25 | AssertNotDisposed(); 26 | DnsChallenge challenge = (DnsChallenge)ctx.Challenge; 27 | var helper = new CloudFlareHelper(AuthKey, EmailAddress, DomainName); 28 | helper.DeleteDnsRecord(challenge.RecordName); 29 | 30 | ctx.Out.WriteLine("DNS record deleted of type [TXT] with name [{0}]", challenge.RecordName); 31 | } 32 | 33 | private string GetCleanedRecordValue(string recordValue) 34 | { 35 | var dnsValue = Regex.Replace(recordValue, "\\s", ""); 36 | var dnsValues = string.Join("\" \"", Regex.Replace(dnsValue, "(.{100,100})", "$1\n").Split('\n')); 37 | return dnsValues; 38 | } 39 | 40 | private void AssertNotDisposed() 41 | { 42 | if (IsDisposed) 43 | throw new InvalidOperationException("AWS Challenge Handler is disposed"); 44 | } 45 | 46 | public void Dispose() 47 | { 48 | IsDisposed = true; 49 | } 50 | 51 | public bool IsDisposed { get; private set; } 52 | } 53 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp CloudFlare Provider")] 9 | [assembly: AssemblyDescription("CloudFlare Provider extension for ACMESharp")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Providers.CloudFlare")] 13 | [assembly: AssemblyCopyright("Copyright © 2016 Jan-Pieter Zoutewelle. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("63ae964a-79a4-4c7d-a686-dd9b2389af3f")] 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/Results/DnsRecord.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Providers.CloudFlare 2 | { 3 | internal class DnsRecord 4 | { 5 | public string Id { get; set; } 6 | public string Type { get; set; } 7 | public string Name { get; set; } 8 | public string Content { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/Results/DnsResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ACMESharp.Providers.CloudFlare.Results 4 | { 5 | internal class DnsResult 6 | { 7 | public DnsRecord[] Result { get; set; } 8 | [JsonProperty("result_info")] 9 | public ResultInfo ResultInfo { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/Results/ResultInfo.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ACMESharp.Providers.CloudFlare.Results 4 | { 5 | internal class ResultInfo 6 | { 7 | public int Page { get; set; } 8 | [JsonProperty("per_page")] 9 | public int PerPage { get; set; } 10 | [JsonProperty("total_pages")] 11 | public int TotalPages { get; set; } 12 | public int Count { get; set; } 13 | [JsonProperty("total_count")] 14 | public int TotalCount { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/Results/Zone.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Providers.CloudFlare.Results 2 | { 3 | internal class Zone 4 | { 5 | public string Id { get; set; } 6 | public string Name { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/Results/ZoneResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ACMESharp.Providers.CloudFlare.Results 4 | { 5 | internal class ZoneResult 6 | { 7 | public Zone[] Result { get; set; } 8 | [JsonProperty("result_info")] 9 | public ResultInfo ResultInfo { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.CloudFlare/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DNSMadeEasy/ACMESharp.Providers.DNSMadeEasy.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Provider Lib for DNS Made Easy. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp dnsmadeeasy 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DNSMadeEasy/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp DNS-Made-Easy Provider")] 9 | [assembly: AssemblyDescription("DNS-Made-Easy Provider extension for ACMESharp")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Providers.DNSMadeEasy")] 13 | [assembly: AssemblyCopyright("Copyright © 2017 Matthew Steeples. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bc6d303a-71fb-4cc7-8d30-3c3b09f9c92a")] 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DNSMadeEasy/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DuckDNS/ACMESharp.Providers.DuckDNS.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Provider Lib for Duck DNS. 16 | Copyright © 2019 Philipp Nanz 17 | pki ssl tls security certificates letsencrypt acme acmesharp duckdns 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DuckDNS/DuckDnsChallengeHandler.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.ACME; 2 | using System; 3 | using System.Net; 4 | 5 | namespace ACMESharp.Providers.DuckDNS 6 | { 7 | public class DuckDnsChallengeHandler : IChallengeHandler 8 | { 9 | public string Token { get; set; } 10 | 11 | public bool IsDisposed 12 | { 13 | get; private set; 14 | } 15 | 16 | public void CleanUp(ChallengeHandlingContext ctx) 17 | { 18 | var dnsChallenge = (DnsChallenge)ctx.Challenge; 19 | var domain = GetDomainId(dnsChallenge); 20 | 21 | var wr = CreateRequest(Token, domain, ""); 22 | using (var response = wr.GetResponse()) 23 | { } 24 | } 25 | 26 | private void AssertNotDisposed() 27 | { 28 | if (IsDisposed) 29 | throw new InvalidOperationException("handler is disposed"); 30 | } 31 | 32 | public void Dispose() 33 | { 34 | IsDisposed = true; 35 | } 36 | 37 | public void Handle(ChallengeHandlingContext ctx) 38 | { 39 | AssertNotDisposed(); 40 | var dnsChallenge = (DnsChallenge)ctx.Challenge; 41 | var domain = GetDomainId(dnsChallenge); 42 | 43 | var wr = CreateRequest(Token, domain, dnsChallenge.RecordValue); 44 | using (var response = wr.GetResponse()) 45 | { } 46 | } 47 | 48 | string GetDomainId(DnsChallenge dnsChallenge) 49 | { 50 | var segments = dnsChallenge.RecordName.Split('.'); 51 | return segments[1]; 52 | } 53 | 54 | WebRequest CreateRequest(string token, string domain, string text) 55 | { 56 | var url = "https://www.duckdns.org/update?token=" + token + "&domains=" + domain + "&txt=" + text; 57 | if (String.IsNullOrEmpty(text)) 58 | { 59 | url += "&clear=true"; 60 | } 61 | Console.WriteLine("Executing web request: " + url); 62 | return WebRequest.Create(url); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DuckDNS/DuckDnsChallengeHandlerProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.ACME; 2 | using ACMESharp.Ext; 3 | using System.Collections.Generic; 4 | 5 | namespace ACMESharp.Providers.DuckDNS 6 | { 7 | /// 8 | /// Provider for a Challenge Handler that updates the TXT records on a 9 | /// Duck DNS account. 10 | /// 11 | [ChallengeHandlerProvider("duckdns", 12 | ChallengeTypeKind.DNS, 13 | Label = "Duck DNS Provider", 14 | Description = "A Duck DNS provider for handling Challenges." + 15 | " This provider supports the DNS" + 16 | " Challenge type and computes all the necessary" + 17 | " response values.")] 18 | public class DuckDnsChallengeHandlerProvider : IChallengeHandlerProvider 19 | { 20 | public static readonly ParameterDetail TOKEN = new ParameterDetail( 21 | nameof(DuckDnsChallengeHandler.Token), 22 | ParameterType.TEXT, isRequired: true, label: "Token", 23 | desc: "The Token for your Duck DNS account"); 24 | 25 | private static readonly ParameterDetail[] PARAMS = 26 | { 27 | TOKEN 28 | }; 29 | 30 | public IEnumerable DescribeParameters() 31 | { 32 | return PARAMS; 33 | } 34 | 35 | public bool IsSupported(Challenge c) 36 | { 37 | return c is DnsChallenge; 38 | } 39 | 40 | public IChallengeHandler GetHandler(Challenge c, IReadOnlyDictionary initParams) 41 | { 42 | if (initParams == null) 43 | initParams = new Dictionary(); 44 | 45 | if (!initParams.ContainsKey(TOKEN.Name)) 46 | throw new KeyNotFoundException($"missing required parameter [{TOKEN.Name}]"); 47 | 48 | var h = new DuckDnsChallengeHandler(); 49 | 50 | h.Token = (string)initParams[TOKEN.Name]; 51 | 52 | return h; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DuckDNS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("ACMESharp Duck DNS Provider")] 8 | [assembly: AssemblyDescription("Duck DNS Provider extension for ACMESharp")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 11 | [assembly: AssemblyProduct("ACMESharp.Providers.DuckDNS")] 12 | [assembly: AssemblyCopyright("Copyright © 2019 Philipp Nanz. All rights reserved.")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("bc6d303a-71fb-4cc7-8d30-3c3b09f9c92a")] 23 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.DuckDNS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.IIS/ACMESharp.Providers.IIS.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Provider Lib for Microsoft IIS. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.IIS/IisChallengeHandler-WebConfig: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.IIS/IisWebSiteBinding.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Providers.IIS 8 | { 9 | public class IisWebSiteBinding 10 | { 11 | public long SiteId 12 | { get; set; } 13 | 14 | public string SiteName 15 | { get; set; } 16 | 17 | public string BindingProtocol 18 | { get; set; } 19 | 20 | public string BindingAddress 21 | { get; set; } 22 | 23 | public string BindingPort 24 | { get; set; } 25 | 26 | public string BindingHost 27 | { get; set; } 28 | 29 | public bool? BindingHostRequired 30 | { get; set; } 31 | 32 | public string SiteRoot 33 | { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.IIS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp IIS Provider")] 9 | [assembly: AssemblyDescription("Microsoft IIS Provider extension for ACMESharp")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Providers.IIS")] 13 | [assembly: AssemblyCopyright("Copyright © " + ASMINFO.COPYRIGHT_YEAR + " Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("944ec9bd-81a1-484e-ba29-360bc155bf51")] 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.IIS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.Windows/ACMESharp.Providers.Windows.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Providers Lib for Microsoft Windows. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.Windows/MSDNSChallengeHandlerProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.ACME; 2 | using ACMESharp.Ext; 3 | using System.Collections.Generic; 4 | 5 | namespace ACMESharp.Providers.Windows 6 | { 7 | /// 8 | /// Provider for a Challenge Handler that outputs the manual steps 9 | /// needed to be completed by the operator. 10 | /// 11 | /// 12 | /// When the output resolves to a file and that file already exists, 13 | /// unless either the Append or Overwrite parameters are specified 14 | /// as true, an exception will be raised. 15 | /// 16 | [ChallengeHandlerProvider("msdns", 17 | ChallengeTypeKind.DNS, 18 | isCleanUpSupported: false, 19 | Label = "Microsoft DNS Provider", 20 | Description = "A microsoft dns provider for handling Challenges." + 21 | " This provider supports the DNS" + 22 | " Challenge type and computes all the necessary" + 23 | " response values. It will create DNS entries.")] 24 | public class MSDNSChallengeHandlerProvider : IChallengeHandlerProvider 25 | { 26 | private static readonly ParameterDetail[] PARAMS = 27 | { 28 | }; 29 | 30 | public IEnumerable DescribeParameters() 31 | { 32 | return PARAMS; 33 | } 34 | 35 | public bool IsSupported(Challenge c) 36 | { 37 | return c is DnsChallenge; 38 | } 39 | 40 | public IChallengeHandler GetHandler(Challenge c, IReadOnlyDictionary initParams) 41 | { 42 | var h = new MSDNSChallengeHandler(); 43 | 44 | return h; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Providers.Windows/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp Windows Providers")] 9 | [assembly: AssemblyDescription("Various Windows Provider extensions for ACMESharp")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Providers.Windows")] 13 | [assembly: AssemblyCopyright("Copyright © " + ASMINFO.COPYRIGHT_YEAR + " Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f085d9bb-0df5-442b-8340-6250792a8d7a")] 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault-test/LocalDiskVaultProviderTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace ACMESharp.Vault 6 | { 7 | [TestClass] 8 | public class LocalDiskVaultProviderTests 9 | { 10 | [TestMethod] 11 | public void TestProviderNamesCount() 12 | { 13 | var all = VaultExtManager.GetProviderInfos(); 14 | 15 | // Make sure at least the local disk and the default 16 | Assert.IsTrue(all.Count() > 0); 17 | } 18 | 19 | [TestMethod] 20 | public void TestDefaultProvider() 21 | { 22 | var p = VaultExtManager.GetProvider(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault-test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp.Vault-test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Vault-test")] 13 | [assembly: AssemblyCopyright("Copyright © Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("11753766-7b14-4d33-bf2f-11caae6c4854")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.0.0.0")] 36 | [assembly: AssemblyFileVersion("0.0.0.0")] 37 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/ACMESharp.Vault.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Vault Lib. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/IVault.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using ACMESharp.Ext; 8 | using ACMESharp.Vault.Model; 9 | 10 | namespace ACMESharp.Vault 11 | { 12 | public interface IVault : IDisposable 13 | { 14 | #region -- Properties -- 15 | 16 | bool IsDisposed 17 | { get; } 18 | 19 | bool IsStorageOpen 20 | { get; } 21 | 22 | #endregion -- Properties -- 23 | 24 | #region -- Methods -- 25 | 26 | bool TestStorage(); 27 | 28 | void InitStorage(bool force = false); 29 | 30 | void OpenStorage(bool initOrOpen = false); 31 | 32 | VaultInfo LoadVault(bool required = true); 33 | 34 | void SaveVault(VaultInfo vault); 35 | 36 | IEnumerable ListAssets(string nameRegex = null, params VaultAssetType[] type); 37 | 38 | VaultAsset CreateAsset(VaultAssetType type, string name, bool isSensitive = false, 39 | bool getOrCreate = false); 40 | 41 | VaultAsset GetAsset(VaultAssetType type, string name); 42 | 43 | Stream SaveAsset(VaultAsset asset); 44 | 45 | Stream LoadAsset(VaultAsset asset); 46 | 47 | #endregion -- Methods -- 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/IVaultProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Vault 9 | { 10 | public interface IVaultProvider // : IDisposable 11 | { 12 | IEnumerable DescribeParameters(); 13 | 14 | IVault GetVault(IReadOnlyDictionary initParams); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/IVaultProviderInfo.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Vault 9 | { 10 | public interface IVaultProviderInfo : IAliasesSupported 11 | { 12 | string Name 13 | { get; } 14 | 15 | string Label 16 | { get; } 17 | 18 | string Description 19 | { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/CertificateInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACMESharp.Vault.Model 4 | { 5 | public class CertificateInfo : IIdentifiable 6 | { 7 | public Guid Id 8 | { get; set; } 9 | 10 | public string Alias 11 | { get; set; } 12 | 13 | public string Label 14 | { get; set; } 15 | 16 | public string Memo 17 | { get; set; } 18 | 19 | public Guid IdentifierRef 20 | { get; set; } 21 | 22 | public string IdentifierDns 23 | { get; set; } 24 | 25 | public string[] AlternativeIdentifierDns 26 | { get; set; } 27 | 28 | public string KeyPemFile 29 | { get; set; } 30 | 31 | public string CsrPemFile 32 | { get; set; } 33 | 34 | public string GenerateDetailsFile 35 | { get; set; } 36 | 37 | public CertificateRequest CertificateRequest 38 | { get; set; } 39 | 40 | public string CrtPemFile 41 | { get; set; } 42 | 43 | public string CrtDerFile 44 | { get; set; } 45 | 46 | public string IssuerSerialNumber 47 | { get; set; } 48 | 49 | public string SerialNumber 50 | { get; set; } 51 | 52 | public string Thumbprint 53 | { get; set; } 54 | 55 | public string Signature 56 | { get; set; } 57 | 58 | public string SignatureAlgorithm 59 | { get; set; } 60 | 61 | public DateTime? RevokedAt 62 | { get; set; } 63 | 64 | public int NumBits { get; set; } = 2048; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/IdentifierInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ACMESharp.Vault.Model 5 | { 6 | public class IdentifierInfo : IIdentifiable 7 | { 8 | public Guid Id 9 | { get; set; } 10 | 11 | public string Alias 12 | { get; set; } 13 | 14 | public string Label 15 | { get; set; } 16 | 17 | public string Memo 18 | { get; set; } 19 | 20 | public Guid RegistrationRef 21 | { get; set; } 22 | 23 | public string Dns 24 | { get; set; } 25 | 26 | public AuthorizationState Authorization 27 | { get; set; } 28 | 29 | public Dictionary Challenges 30 | { get; set; } 31 | 32 | public Dictionary ChallengeCompleted 33 | { get; set; } 34 | 35 | public Dictionary ChallengeCleanedUp 36 | { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/InstallerProfileInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault.Model 8 | { 9 | public class InstallerProfileInfo: IIdentifiable 10 | { 11 | public Guid Id 12 | { get; set; } 13 | 14 | public string Alias 15 | { get; set; } 16 | 17 | public string Label 18 | { get; set; } 19 | 20 | public string Memo 21 | { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/IssuerCertificateInfo.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Vault.Model 2 | { 3 | public class IssuerCertificateInfo 4 | { 5 | public string SerialNumber 6 | { get; set; } 7 | 8 | public string Thumbprint 9 | { get; set; } 10 | 11 | public string Signature 12 | { get; set; } 13 | 14 | public string SignatureAlgorithm 15 | { get; set; } 16 | 17 | public string CrtPemFile 18 | { get; set; } 19 | 20 | public string CrtDerFile 21 | { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/ProviderProfileInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault.Model 8 | { 9 | public class ProviderProfileInfo: IIdentifiable 10 | { 11 | public Guid Id 12 | { get; set; } 13 | 14 | public string Alias 15 | { get; set; } 16 | 17 | public string Label 18 | { get; set; } 19 | 20 | public string Memo 21 | { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/ProxyConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Text; 4 | 5 | namespace ACMESharp.Vault.Model 6 | { 7 | public class ProxyConfig 8 | { 9 | 10 | public bool UseNoProxy 11 | { get; set; } 12 | 13 | public string ProxyUri 14 | { get; set; } 15 | 16 | public bool UseDefCred 17 | { get; set; } 18 | 19 | public string Username 20 | { get; set; } 21 | 22 | public string PasswordEncoded 23 | { get; set; } 24 | 25 | /// 26 | /// Computes a web proxy resolver instance 27 | /// based on the combination of proxy-related settings in this vault 28 | /// configuration. 29 | /// 30 | /// 31 | public IWebProxy GetWebProxy() 32 | { 33 | IWebProxy wp = null; 34 | 35 | if (UseNoProxy) 36 | { 37 | wp = GlobalProxySelection.GetEmptyWebProxy(); 38 | } 39 | else if (!string.IsNullOrEmpty(ProxyUri)) 40 | { 41 | var newwp = new WebProxy(ProxyUri); 42 | if (UseDefCred) 43 | { 44 | newwp.UseDefaultCredentials = true; 45 | } 46 | else if (!string.IsNullOrEmpty(Username)) 47 | { 48 | var pw = PasswordEncoded; 49 | if (!string.IsNullOrEmpty(pw)) 50 | pw = Encoding.Unicode.GetString(Convert.FromBase64String(pw)); 51 | newwp.Credentials = new NetworkCredential(Username, pw); 52 | } 53 | } 54 | 55 | return wp; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/RegistrationInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACMESharp.Vault.Model 4 | { 5 | public class RegistrationInfo : IIdentifiable 6 | { 7 | public Guid Id 8 | { get; set; } 9 | 10 | public string Alias 11 | { get; set; } 12 | 13 | public string Label 14 | { get; set; } 15 | 16 | public string Memo 17 | { get; set; } 18 | 19 | public string SignerProvider 20 | { get; set; } 21 | 22 | public string SignerState 23 | { get; set; } 24 | 25 | public AcmeRegistration Registration 26 | { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Model/VaultInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ACMESharp.Vault.Util; 3 | 4 | namespace ACMESharp.Vault.Model 5 | { 6 | public class VaultInfo 7 | { 8 | public Guid Id 9 | { get; set; } 10 | 11 | public string Alias 12 | { get; set; } 13 | 14 | public string Label 15 | { get; set; } 16 | 17 | public string Memo 18 | { get; set; } 19 | 20 | public string BaseService 21 | { get; set; } 22 | 23 | public string BaseUri 24 | { get; set; } 25 | 26 | public string Signer 27 | { get; set; } 28 | 29 | public string PkiTool 30 | { get; set; } 31 | 32 | public bool GetInitialDirectory 33 | { get; set; } = true; 34 | 35 | public bool UseRelativeInitialDirectory 36 | { get; set; } = true; 37 | 38 | public AcmeServerDirectory ServerDirectory 39 | { get; set; } 40 | 41 | public ProxyConfig Proxy 42 | { get; set; } 43 | 44 | public EntityDictionary ProviderProfiles 45 | { get; set; } 46 | 47 | public EntityDictionary InstallerProfiles 48 | { get; set; } 49 | 50 | public EntityDictionary Registrations 51 | { get; set; } 52 | 53 | public EntityDictionary Identifiers 54 | { get; set; } 55 | 56 | public EntityDictionary Certificates 57 | { get; set; } 58 | 59 | public OrderedNameMap IssuerCertificates 60 | { get; set; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Profile/InstallerProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault.Profile 8 | { 9 | public class InstallerProfile 10 | { 11 | public string InstallerProvider 12 | { get; set; } 13 | 14 | public IReadOnlyDictionary InstanceParameters 15 | { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Profile/ProviderProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault.Profile 8 | { 9 | public enum ProviderType 10 | { 11 | CUSTOM = 0, 12 | 13 | VAULT = 1, 14 | CHALLENGE_DECODER = 2, 15 | CHALLENGE_HANDLER = 3, 16 | PKI = 4, 17 | INSTALLER = 5, 18 | } 19 | 20 | public class ProviderProfile 21 | { 22 | public ProviderType ProviderType 23 | { get; set; } 24 | 25 | public string ProviderCustomType 26 | { get; set; } 27 | 28 | public string ProviderName 29 | { get; set; } 30 | 31 | public IReadOnlyDictionary ProviderParameters 32 | { get; set; } 33 | 34 | public IReadOnlyDictionary InstanceParameters 35 | { get; set; } 36 | 37 | public IReadOnlyDictionary ProfileParameters 38 | { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp Vault")] 9 | [assembly: AssemblyDescription("Vault support for ACMESharp")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 12 | [assembly: AssemblyProduct("ACMESharp.Vault")] 13 | [assembly: AssemblyCopyright("Copyright © " + ASMINFO.COPYRIGHT_YEAR + " Eugene Bekker. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("65b4c6e0-27a0-445c-adac-9d8308e2e4a6")] 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Providers/EntityMeta.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault.Providers 8 | { 9 | /// 10 | /// Basic wrapper around any entity that we save using this file-based 11 | /// provider in order to track common meta data about the entity. 12 | /// 13 | /// 14 | public class EntityMeta 15 | { 16 | public DateTime CreateDate 17 | { get; set; } 18 | 19 | public string CreateUser 20 | { get; set; } 21 | 22 | public string CreateHost 23 | { get; set; } 24 | 25 | public DateTime UpdateDate 26 | { get; set; } 27 | 28 | public string UpdateUser 29 | { get; set; } 30 | 31 | public T Entity 32 | { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Providers/FileVaultAsset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault.Providers 8 | { 9 | public class FileVaultAsset : VaultAsset 10 | { 11 | public FileVaultAsset(string path, string name, VaultAssetType type, bool isSensitive) 12 | { 13 | Path = path; 14 | Name = name; 15 | Type = type; 16 | IsSensitive = isSensitive; 17 | } 18 | 19 | public string Path 20 | { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Util/EntityHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACMESharp.Vault.Util 4 | { 5 | public static class EntityHelper 6 | { 7 | public static Guid NewId() 8 | { 9 | return Guid.NewGuid(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/Util/IIdentifiable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACMESharp.Vault.Model 4 | { 5 | public interface IIdentifiable 6 | { 7 | Guid Id 8 | { get; } 9 | 10 | string Alias 11 | { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/VaultAsset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault 8 | { 9 | public class VaultAsset 10 | { 11 | public virtual string Name 12 | { get; protected set; } 13 | 14 | public virtual VaultAssetType Type 15 | { get; protected set; } 16 | 17 | public virtual bool IsSensitive 18 | { get; protected set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/VaultAssetType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Vault 8 | { 9 | 10 | public enum VaultAssetType 11 | { 12 | Other = 0, 13 | 14 | /// 15 | /// A DnsInfo or WebServerInfo file to instantiate and 16 | /// configure a Provider for handling a Challenge. 17 | /// 18 | ProviderConfigInfo, 19 | 20 | /// 21 | /// Stores intermediate details when generating a CSR. 22 | /// 23 | CsrDetails, 24 | 25 | /// 26 | /// Imported or generated private key PEM file. 27 | /// 28 | KeyPem, 29 | /// 30 | /// Imported or generated CSR PEM file. 31 | /// 32 | CsrPem, 33 | 34 | /// 35 | /// Generated private key full details. 36 | /// 37 | KeyGen, 38 | /// 39 | /// Generated CSR full details. 40 | /// 41 | CsrGen, 42 | 43 | /// 44 | /// DER-encoded form of CSR (used directly in the ACME protocol). 45 | /// 46 | CsrDer, 47 | 48 | /// 49 | /// DER-encoded form of the issued cert (returned from CA as per ACME spec). 50 | /// 51 | CrtDer, 52 | /// 53 | /// PEM-encoded form of the issued cert. 54 | /// 55 | CrtPem, 56 | 57 | IssuerDer, 58 | IssuerPem, 59 | 60 | /// 61 | /// An InstallerProfileInfofile to instantiate and 62 | /// configure a Provider for installing a certificate. 63 | /// 64 | InstallerConfigInfo, 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/VaultProviderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Vault 9 | { 10 | [MetadataAttribute] 11 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 12 | public class VaultProviderAttribute : ExportAttribute 13 | { 14 | public VaultProviderAttribute(string name) 15 | : base(typeof(IVaultProvider)) 16 | { 17 | Name = name; 18 | } 19 | 20 | public string Name 21 | { get; private set; } 22 | 23 | public string[] Aliases 24 | { get; set; } 25 | 26 | public string Label 27 | { get; set; } 28 | 29 | public string Description 30 | { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp.Vault/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/ChallengeDecoderProviderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.ACME 9 | { 10 | [MetadataAttribute] 11 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 12 | public class ChallengeDecoderProviderAttribute : ExportAttribute 13 | { 14 | public ChallengeDecoderProviderAttribute(string type, 15 | ChallengeTypeKind supportedType) : base(typeof(IChallengeDecoderProvider)) 16 | { 17 | Type = type; 18 | SupportedType = supportedType; 19 | } 20 | 21 | public ChallengeTypeKind SupportedType 22 | { get; private set; } 23 | 24 | public string Type 25 | { get; private set; } 26 | 27 | public string Label 28 | { get; set; } 29 | 30 | public string Description 31 | { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/ChallengeHandlerProviderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.ACME 9 | { 10 | [MetadataAttribute] 11 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 12 | public class ChallengeHandlerProviderAttribute : ExportAttribute 13 | { 14 | public ChallengeHandlerProviderAttribute(string name, 15 | ChallengeTypeKind supportedTypes, 16 | bool isCleanUpSupported = false) : base(typeof(IChallengeHandlerProvider)) 17 | { 18 | Name = name; 19 | SupportedTypes = supportedTypes; 20 | IsCleanUpSupported = isCleanUpSupported; 21 | } 22 | 23 | public string Name 24 | { get; private set; } 25 | 26 | public string[] Aliases 27 | { get; set; } 28 | 29 | public string Label 30 | { get; set; } 31 | 32 | public string Description 33 | { get; set; } 34 | 35 | public ChallengeTypeKind SupportedTypes 36 | { get; private set; } 37 | 38 | public bool IsCleanUpSupported 39 | { get; private set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/ChallengeHandlingContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.ACME 9 | { 10 | public class ChallengeHandlingContext 11 | { 12 | /// 13 | /// Constructs a context instance. 14 | /// 15 | /// 16 | /// if null, defaults to Console.Out 17 | public ChallengeHandlingContext(Challenge c, TextWriter outWriter = null) 18 | { 19 | Challenge = c; 20 | if (outWriter == null) 21 | outWriter = System.Console.Out; 22 | Out = outWriter; 23 | } 24 | 25 | public Challenge Challenge 26 | { get; } 27 | 28 | public TextWriter Out 29 | { get; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/IChallengeDecoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ACMESharp.Ext; 7 | using ACMESharp.JOSE; 8 | using ACMESharp.Messages; 9 | 10 | namespace ACMESharp.ACME 11 | { 12 | /// 13 | /// Defines the Provider interface needed to support discovery 14 | /// and instance-creation of a Challenge Decoder. 16 | /// 17 | public interface IChallengeDecoderProvider // : IDisposable 18 | { 19 | bool IsSupported(IdentifierPart ip, ChallengePart cp); 20 | 21 | IChallengeDecoder GetDecoder(IdentifierPart ip, ChallengePart cp); 22 | } 23 | 24 | /// 25 | /// Defines the interface needed to support implementations of 26 | /// Challenge Decoder. 27 | /// 28 | /// 29 | /// Challenge Decoders are those components that are able to parse 30 | /// the Challenge part of a new Authorization response message and 31 | /// compute the needed elements of a Challenge Response which will 32 | /// be handled by a Challenge Handler. 33 | /// They are also responsible for computing an answer which will be used in computing an answer request 35 | /// message to be sent by the ACME client to the server once a 36 | /// Challenge has been handled and satisfied. 37 | /// 38 | public interface IChallengeDecoder : IDisposable 39 | { 40 | #region -- Properties -- 41 | 42 | bool IsDisposed { get; } 43 | 44 | #endregion -- Properties -- 45 | 46 | #region -- Methods -- 47 | 48 | Challenge Decode(IdentifierPart ip, ChallengePart cp, ISigner signer); 49 | 50 | #endregion -- Methods -- 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/IChallengeDecoderProviderInfo.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | 3 | namespace ACMESharp.ACME 4 | { 5 | public interface IChallengeDecoderProviderInfo 6 | 7 | { 8 | string Type 9 | { get; } 10 | 11 | ChallengeTypeKind SupportedType 12 | { get; } 13 | 14 | string Label 15 | { get; } 16 | 17 | string Description 18 | { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/IChallengeHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ACMESharp.Ext; 7 | 8 | namespace ACMESharp.ACME 9 | { 10 | /// 11 | /// Defines the Provider interface needed to support discovery 12 | /// and instance-creation of a Challenge Handler. 14 | /// 15 | public interface IChallengeHandlerProvider // : IDisposable 16 | { 17 | IEnumerable DescribeParameters(); 18 | 19 | bool IsSupported(Challenge c); 20 | 21 | IChallengeHandler GetHandler(Challenge c, IReadOnlyDictionary initParams); 22 | } 23 | 24 | /// 25 | /// Defines the interface needed to support implementations of 26 | /// Challenge Handlers. 27 | /// 28 | /// 29 | /// Challenge Handlers are those components that are able to satisfy 30 | /// the Challenges issued by an ACME server as part of a request to 31 | /// Authorize an Identifier. 32 | /// 33 | public interface IChallengeHandler : IDisposable 34 | { 35 | #region -- Properties -- 36 | 37 | bool IsDisposed { get; } 38 | 39 | #endregion -- Properties -- 40 | 41 | #region -- Methods -- 42 | 43 | void Handle(ChallengeHandlingContext ctx); 44 | 45 | void CleanUp(ChallengeHandlingContext ctx); 46 | 47 | #endregion -- Methods -- 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/IChallengeHandlerProviderInfo.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | 3 | namespace ACMESharp.ACME 4 | { 5 | public interface IChallengeHandlerProviderInfo : IAliasesSupported 6 | { 7 | string Name 8 | { get; } 9 | 10 | string Label 11 | { get; } 12 | 13 | string Description 14 | { get; } 15 | 16 | ChallengeTypeKind SupportedTypes 17 | { get; } 18 | 19 | bool IsCleanUpSupported 20 | { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/Providers/DnsChallengeDecoder.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.JOSE; 2 | using ACMESharp.Messages; 3 | using ACMESharp.Util; 4 | using NLog; 5 | using System.IO; 6 | 7 | namespace ACMESharp.ACME.Providers 8 | { 9 | public class DnsChallengeDecoder : IChallengeDecoder 10 | { 11 | private static readonly Logger LOG = LogManager.GetCurrentClassLogger(); 12 | 13 | public bool IsDisposed 14 | { get; private set; } 15 | 16 | public Challenge Decode(IdentifierPart ip, ChallengePart cp, ISigner signer) 17 | { 18 | if (cp.Type != AcmeProtocol.CHALLENGE_TYPE_DNS) 19 | throw new InvalidDataException("unsupported Challenge type") 20 | .With("challengeType", cp.Type) 21 | .With("supportedChallengeTypes", AcmeProtocol.CHALLENGE_TYPE_DNS); 22 | 23 | //var token = (string)cp["token"]; 24 | var token = cp.Token; 25 | 26 | // This response calculation is described in: 27 | // https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.5 28 | 29 | var keyAuthz = JwsHelper.ComputeKeyAuthorization(signer, token); 30 | var keyAuthzDig = JwsHelper.ComputeKeyAuthorizationDigest(signer, token); 31 | 32 | LOG.Debug("Computed key authorization {0} and digest {1}", keyAuthz, keyAuthzDig); 33 | 34 | var ca = new DnsChallengeAnswer 35 | { 36 | KeyAuthorization = keyAuthz, 37 | }; 38 | 39 | var c = new DnsChallenge(cp.Type, ca) 40 | { 41 | Token = token, 42 | RecordName = $"{AcmeProtocol.DNS_CHALLENGE_NAMEPREFIX}{ip.Value}", 43 | RecordValue = keyAuthzDig, 44 | }; 45 | 46 | return c; 47 | } 48 | 49 | public void Dispose() 50 | { 51 | IsDisposed = true; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/Providers/DnsChallengeDecoderProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Messages; 2 | 3 | namespace ACMESharp.ACME.Providers 4 | { 5 | [ChallengeDecoderProvider("dns-01", ChallengeTypeKind.DNS, 6 | Description = "Challenge type decoder for the DNS type" + 7 | " as specified in" + 8 | " https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.5")] 9 | public class DnsChallengeDecoderProvider : IChallengeDecoderProvider 10 | { 11 | public bool IsSupported(IdentifierPart ip, ChallengePart cp) 12 | { 13 | return AcmeProtocol.CHALLENGE_TYPE_DNS == cp.Type; 14 | } 15 | 16 | public IChallengeDecoder GetDecoder(IdentifierPart ip, ChallengePart cp) 17 | { 18 | return new DnsChallengeDecoder(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/Providers/HttpChallengeDecoder.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using ACMESharp.JOSE; 3 | using ACMESharp.Messages; 4 | using ACMESharp.Util; 5 | 6 | namespace ACMESharp.ACME.Providers 7 | { 8 | public class HttpChallengeDecoder : IChallengeDecoder 9 | { 10 | public bool IsDisposed 11 | { get; private set; } 12 | 13 | public Challenge Decode(IdentifierPart ip, ChallengePart cp, ISigner signer) 14 | { 15 | if (cp.Type != AcmeProtocol.CHALLENGE_TYPE_HTTP) 16 | throw new InvalidDataException("unsupported Challenge type") 17 | .With("challengeType", cp.Type) 18 | .With("supportedChallengeTypes", AcmeProtocol.CHALLENGE_TYPE_HTTP); 19 | 20 | //var token = (string)cp["token"]; 21 | var token = cp.Token; 22 | 23 | // This response calculation is described in: 24 | // https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.2 25 | 26 | var keyAuthz = JwsHelper.ComputeKeyAuthorization(signer, token); 27 | var path = $"{AcmeProtocol.HTTP_CHALLENGE_PATHPREFIX}{token}"; 28 | var url = $"http://{ip.Value}/{path}"; 29 | 30 | 31 | var ca = new HttpChallengeAnswer 32 | { 33 | KeyAuthorization = keyAuthz, 34 | }; 35 | 36 | var c = new HttpChallenge(cp.Type, ca) 37 | { 38 | Token = token, 39 | FileUrl = url, 40 | FilePath = path, 41 | FileContent = keyAuthz, 42 | }; 43 | 44 | return c; 45 | } 46 | 47 | public void Dispose() 48 | { 49 | IsDisposed = true; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/Providers/HttpChallengeDecoderProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Messages; 2 | 3 | namespace ACMESharp.ACME.Providers 4 | { 5 | [ChallengeDecoderProvider("http-01", ChallengeTypeKind.HTTP, 6 | Description = "Challenge type decoder for the HTTP type" + 7 | " as specified in" + 8 | " https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.2")] 9 | public class HttpChallengeDecoderProvider : IChallengeDecoderProvider 10 | { 11 | public bool IsSupported(IdentifierPart ip, ChallengePart cp) 12 | { 13 | return AcmeProtocol.CHALLENGE_TYPE_HTTP == cp.Type; 14 | } 15 | 16 | public IChallengeDecoder GetDecoder(IdentifierPart ip, ChallengePart cp) 17 | { 18 | return new HttpChallengeDecoder(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/Providers/TlsSniChallengeDecoder.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.JOSE; 2 | using ACMESharp.Messages; 3 | using ACMESharp.Util; 4 | using NLog; 5 | using System.IO; 6 | 7 | namespace ACMESharp.ACME.Providers 8 | { 9 | public class TlsSniChallengeDecoder : IChallengeDecoder 10 | { 11 | private static readonly Logger LOG = LogManager.GetCurrentClassLogger(); 12 | 13 | public bool IsDisposed 14 | { get; private set; } 15 | 16 | public Challenge Decode(IdentifierPart ip, ChallengePart cp, ISigner signer) 17 | { 18 | if (cp.Type != AcmeProtocol.CHALLENGE_TYPE_SNI) 19 | throw new InvalidDataException("unsupported Challenge type") 20 | .With("challengeType", cp.Type) 21 | .With("supportedChallengeTypes", AcmeProtocol.CHALLENGE_TYPE_SNI); 22 | 23 | var token = cp.Token; 24 | 25 | // This response calculation is described in: 26 | // https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.3 27 | 28 | var keyAuthz = JwsHelper.ComputeKeyAuthorization(signer, token); 29 | var keyAuthzDig = JwsHelper.ComputeKeyAuthorizationDigest(signer, token); 30 | 31 | LOG.Debug("Computed key authorization {0} and digest {1}", keyAuthz, keyAuthzDig); 32 | 33 | var ca = new TlsSniChallengeAnswer 34 | { 35 | KeyAuthorization = keyAuthz, 36 | }; 37 | 38 | var c = new TlsSniChallenge(cp.Type, ca) 39 | { 40 | Token = token, 41 | IterationCount = 1 // see: https://github.com/ietf-wg-acme/acme/pull/22 for reason n=1 42 | }; 43 | 44 | return c; 45 | } 46 | 47 | public void Dispose() 48 | { 49 | IsDisposed = true; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACME/Providers/TlsSniChallengeDecoderProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Messages; 2 | 3 | namespace ACMESharp.ACME.Providers 4 | { 5 | [ChallengeDecoderProvider(AcmeProtocol.CHALLENGE_TYPE_SNI, ChallengeTypeKind.TLS_SNI, 6 | Description = "Challenge type decoder for the TLS-SNI type" + 7 | " as specified in" + 8 | " https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.3")] 9 | public class TlsSniChallengeDecoderProvider : IChallengeDecoderProvider 10 | { 11 | public bool IsSupported(IdentifierPart ip, ChallengePart cp) 12 | { 13 | return AcmeProtocol.CHALLENGE_TYPE_SNI == cp.Type; 14 | } 15 | 16 | public IChallengeDecoder GetDecoder(IdentifierPart ip, ChallengePart cp) 17 | { 18 | return new TlsSniChallengeDecoder(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/ACMESharp.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | $version$.$buildNum$$versionLabel$ 7 | $title$ 8 | https://github.com/ebekker 9 | https://github.com/ebekker 10 | https://raw.githubusercontent.com/ebekker/ACMESharp/master/LICENSE 11 | https://github.com/ebekker/ACMESharp 12 | https://cdn.rawgit.com/ebekker/ACMESharp/49bf6524da8239ecf258ab3857dfbbf40366ecfd/artwork/ACMESharp-logo-square64.png 13 | false 14 | $description$ 15 | Early-access release of ACMESharp Lib package. 16 | Copyright © 2017 Eugene Bekker 17 | pki ssl tls security certificates letsencrypt acme acmesharp 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/AcmeException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace ACMESharp 5 | { 6 | public class AcmeException : Exception 7 | { 8 | public AcmeException() 9 | { 10 | } 11 | 12 | public AcmeException(string message) : base(message) 13 | { 14 | } 15 | 16 | public AcmeException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected AcmeException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/AcmeRegistration.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace ACMESharp 6 | { 7 | public class AcmeRegistration 8 | { 9 | public IEnumerable Contacts 10 | { get; set; } 11 | 12 | public object PublicKey 13 | { get; set; } 14 | 15 | public object RecoveryKey 16 | { get; set; } 17 | 18 | public string RegistrationUri 19 | { get; set; } 20 | 21 | public IEnumerable Links 22 | { get; set; } 23 | 24 | public string TosLinkUri 25 | { get; set; } 26 | 27 | public string TosAgreementUri 28 | { get; set; } 29 | 30 | public string AuthorizationsUri 31 | { get; set; } 32 | 33 | public string CertificatesUri 34 | { get; set; } 35 | 36 | public void Save(Stream s) 37 | { 38 | using (var w = new StreamWriter(s)) 39 | { 40 | w.Write(JsonConvert.SerializeObject(this, Formatting.Indented)); 41 | } 42 | } 43 | 44 | public static AcmeRegistration Load(Stream s) 45 | { 46 | using (var r = new StreamReader(s)) 47 | { 48 | return JsonConvert.DeserializeObject(r.ReadToEnd()); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/AuthorizationState.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using ACMESharp.Messages; 6 | using ACMESharp.Util; 7 | 8 | namespace ACMESharp 9 | { 10 | public class AuthorizationState 11 | { 12 | public const string STATUS_PENDING = "pending"; 13 | public const string STATUS_PROCESSING = "processing"; 14 | public const string STATUS_VALID = "valid"; 15 | public const string STATUS_INVALID = "invalid"; 16 | public const string STATUS_REVOKED = "revoked"; 17 | 18 | public IdentifierPart IdentifierPart 19 | { get; set; } 20 | 21 | public string IdentifierType 22 | { get; set; } 23 | 24 | public string Identifier 25 | { get; set; } 26 | 27 | public string Uri 28 | { get; set; } 29 | 30 | public string Status 31 | { get; set; } 32 | 33 | public DateTime? Expires 34 | { get; set; } 35 | 36 | public IEnumerable Challenges 37 | { get; set; } 38 | 39 | public IEnumerable> Combinations 40 | { get; set; } 41 | 42 | public bool IsPending() 43 | { 44 | return string.IsNullOrEmpty(Status) || string.Equals(Status, STATUS_PENDING, 45 | StringComparison.InvariantCultureIgnoreCase); 46 | } 47 | 48 | public void Save(Stream s) 49 | { 50 | JsonHelper.Save(s, this); 51 | } 52 | 53 | public static AuthorizationState Load(Stream s) 54 | { 55 | return JsonHelper.Load(s); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/DNS/DnsInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace ACMESharp.DNS 4 | { 5 | public class DnsInfo 6 | { 7 | // TOOD: this is repeated from WebServerInfo, clean this up! 8 | private static Newtonsoft.Json.JsonSerializerSettings JSS = 9 | new Newtonsoft.Json.JsonSerializerSettings 10 | { 11 | Formatting = Newtonsoft.Json.Formatting.Indented, 12 | TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto, 13 | }; 14 | 15 | public string DefaultDomain 16 | { get; set; } 17 | 18 | public XXXIDnsProvider Provider 19 | { get; set; } 20 | 21 | public void Save(System.IO.Stream s) 22 | { 23 | using (var w = new System.IO.StreamWriter(s)) 24 | { 25 | w.Write(Newtonsoft.Json.JsonConvert.SerializeObject(this, JSS)); 26 | } 27 | } 28 | 29 | public string Save() 30 | { 31 | using (var w = new System.IO.MemoryStream()) 32 | { 33 | Save(w); 34 | return Encoding.UTF8.GetString(w.ToArray()); 35 | } 36 | } 37 | 38 | public static DnsInfo Load(System.IO.Stream s) 39 | { 40 | using (var r = new System.IO.StreamReader(s)) 41 | { 42 | return Newtonsoft.Json.JsonConvert.DeserializeObject( 43 | r.ReadToEnd(), JSS); 44 | } 45 | } 46 | 47 | public static DnsInfo Load(string json) 48 | { 49 | using (var r = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(json))) 50 | { 51 | return Load(r); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/DNS/IDnsProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACMESharp.DNS 4 | { 5 | 6 | public interface XXXIDnsProvider 7 | { 8 | void EditTxtRecord(string dnsName, IEnumerable dnsValues); 9 | 10 | void EditARecord(string dnsName, string dnsValue); 11 | 12 | void EditCnameRecord(string dnsName, string dnsValue); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/DNS/ManualDnsProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using ACMESharp.Util; 4 | 5 | namespace ACMESharp.DNS 6 | { 7 | public class ManualDnsProvider : BaseManualProvider, XXXIDnsProvider 8 | { 9 | public void EditTxtRecord(string dnsName, IEnumerable dnsValues) 10 | { 11 | WriteRecord("TXT", dnsName, dnsValues.ToArray()); 12 | } 13 | 14 | public void EditARecord(string dnsName, string dnsValue) 15 | { 16 | WriteRecord("A", dnsName, dnsValue); 17 | } 18 | 19 | public void EditCnameRecord(string dnsName, string dnsValue) 20 | { 21 | WriteRecord("CNAME", dnsName, dnsValue); 22 | } 23 | 24 | private void WriteRecord(string dnsType, string dnsName, params string[] dnsValues) 25 | { 26 | _writer.WriteLine("Manually Configure DNS Resource Record:"); 27 | _writer.WriteLine(" * Type: [{0}]", dnsType); 28 | _writer.WriteLine(" * Name: [{0}]", dnsName); 29 | 30 | if (dnsValues == null || dnsValues.Length == 0) 31 | _writer.WriteLine(" * Value: (N/A)"); 32 | else 33 | { 34 | foreach (var v in dnsValues) 35 | _writer.WriteLine(" * Value: [{0}]", v); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Ext/ExtManagerAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Ext 8 | { 9 | /// 10 | /// A tagging attribute to identify extension managers 11 | /// which are typically implemented as static classes. 12 | /// 13 | [AttributeUsage(AttributeTargets.Class)] 14 | public class ExtManagerAttribute : Attribute 15 | { } 16 | } 17 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Ext/IAliasesSupported.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Ext 8 | { 9 | public interface IAliasesSupported 10 | { 11 | IEnumerable Aliases 12 | { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Ext/IExtDetail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition.Hosting; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Ext 9 | { 10 | public interface IExtDetail 11 | { 12 | CompositionContainer CompositionContainer 13 | { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Ext/NamedInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Ext 8 | { 9 | public struct NamedInfo 10 | { 11 | public NamedInfo(string name, TInfo info) 12 | { 13 | Name = name; 14 | Info = info; 15 | } 16 | 17 | public string Name 18 | { get; private set; } 19 | 20 | public TInfo Info 21 | { get; private set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/HTTP/Link.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace ACMESharp.HTTP 5 | { 6 | /// 7 | /// Represents a Link header value that represents the well-defined HTTP response 8 | /// entity header 9 | /// Link 10 | /// and more fully specified in 11 | /// RFC 5988 Section 5. 12 | /// 13 | /// 14 | /// This class only implements a subset of the mechanics and nuances of the Link header 15 | /// field as necessary for implementing the ACME protocol. 16 | /// 17 | public class Link 18 | { 19 | /// 20 | /// Regex pattern to match and extract the components of an HTTP related link header. 21 | /// 22 | public static readonly Regex LINK_HEADER_REGEX = new Regex("<(.+)>;rel=\"(.+)\""); 23 | 24 | public const string LINK_HEADER_FMT = "<{0}>;rel={1}"; 25 | 26 | public Link(string value) 27 | { 28 | Value = value; 29 | 30 | var m = LINK_HEADER_REGEX.Match(value); 31 | if (!m.Success) 32 | throw new ArgumentException("Invalid Link header format", nameof(value)); 33 | 34 | Uri = m.Groups[1].Value; 35 | Relation = m.Groups[2].Value; 36 | } 37 | 38 | public Link(string uri, string rel) 39 | { 40 | // This will parse the URI to make sure it's well-formed 41 | var parsed = new Uri(uri); 42 | 43 | Uri = uri; 44 | Relation = rel; 45 | Value = string.Format(LINK_HEADER_FMT, uri, rel); 46 | } 47 | 48 | public string Value 49 | { get; private set; } 50 | 51 | public string Uri 52 | { get; private set; } 53 | 54 | public string Relation 55 | { get; private set; } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Installer/IInstaller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Installer 8 | { 9 | /// 10 | /// Defines the interface needed to support implementations of 11 | /// Certificate Installers. 12 | /// 13 | /// 14 | /// Certificate Installers install a private key and a certificate chain 15 | /// into some target system, such as a web server or endpoint service. 16 | /// 17 | public interface IInstaller : IDisposable 18 | { 19 | #region -- Properties -- 20 | 21 | bool IsDisposed { get; } 22 | 23 | #endregion -- Properties -- 24 | 25 | #region -- Methods -- 26 | 27 | void Install(PKI.PrivateKey pk, PKI.Crt crt, IEnumerable chain, 28 | PKI.IPkiTool cp); 29 | 30 | void Uninstall(PKI.PrivateKey pk, PKI.Crt crt, IEnumerable chain, 31 | PKI.IPkiTool cp); 32 | 33 | #endregion -- Methods -- 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Installer/IInstallerProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Installer 9 | { 10 | /// 11 | /// Defines the provider interface need to support discovery 12 | /// and instance-creation of a 13 | /// 14 | public interface IInstallerProvider 15 | { 16 | IEnumerable DescribeParameters(); 17 | 18 | IInstaller GetInstaller(IReadOnlyDictionary initParams); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Installer/IInstallerProviderInfo.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | 3 | namespace ACMESharp.Installer 4 | { 5 | public interface IInstallerProviderInfo : IAliasesSupported 6 | { 7 | string Name 8 | { get; } 9 | 10 | string Label 11 | { get; } 12 | 13 | string Description 14 | { get; } 15 | 16 | bool IsUninstallSupported 17 | { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Installer/InstallerProviderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.Installer 9 | { 10 | [MetadataAttribute] 11 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 12 | public class InstallerProviderAttribute : ExportAttribute 13 | { 14 | public InstallerProviderAttribute(string name) 15 | : base(typeof(IInstallerProvider)) 16 | { 17 | Name = name; 18 | } 19 | 20 | public string Name 21 | { get; private set; } 22 | 23 | public string[] Aliases 24 | { get; set; } 25 | 26 | public string Label 27 | { get; set; } 28 | 29 | public string Description 30 | { get; set; } 31 | 32 | public bool IsUninstallSupported 33 | { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/JOSE/ISigner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ACMESharp.JOSE 5 | { 6 | public interface ISigner : IDisposable 7 | { 8 | string JwsAlg { get; } 9 | 10 | void Init(); 11 | 12 | void Save(Stream stream); 13 | 14 | void Load(Stream stream); 15 | 16 | object ExportJwk(bool canonical = false); 17 | 18 | byte[] Sign(byte[] raw); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/JOSE/JwsHeaders.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.JOSE 2 | { 3 | public static class JwsHeaders 4 | { 5 | /// 6 | /// RFC7515 4.1.1. "alg" (Algorithm) Header Parameter 7 | /// 8 | public const string ALG = "alg"; 9 | /// 10 | /// RFC7515 4.1.2. "jku" (JWK Set URL) Header Parameter 11 | /// 12 | public const string JKU = "jku"; 13 | /// 14 | /// RFC7515 4.1.3. "jwk" (JSON Web Key) Header Parameter 15 | /// 16 | public const string JWK = "jwk"; 17 | /// 18 | /// RFC7515 4.1.4. "kid" (Key ID) Header Parameter 19 | /// 20 | public const string KID = "kid"; 21 | /// 22 | /// RFC7515 4.1.5. "x5u" (X.509 URL) Header Parameter 23 | /// 24 | public const string X5U = "x5u"; 25 | /// 26 | /// RFC7515 4.1.6. "x5c" (X.509 Certificate Chain) Header Parameter 27 | /// 28 | public const string X5C = "x5c"; 29 | /// 30 | /// RFC7515 4.1.7. "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter 31 | /// 32 | public const string X5T = "x5t"; 33 | /// 34 | /// RFC7515 4.1.8. "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Header Parameter 35 | /// 36 | public const string X5TS56 = "x5t#256"; 37 | /// 38 | /// RFC7515 4.1.9. "typ" (Type) Header Parameter 39 | /// 40 | public const string TYP = "typ"; 41 | /// 42 | /// RFC7515 4.1.10. "cty" (Content Type) Header Parameter 43 | /// 44 | public const string CTY = "cty"; 45 | /// 46 | /// RFC7515 4.1.11. "crit" (Critical) Header Parameter 47 | /// 48 | public const string CRIT = "crit"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/JSON/AcmeJsonContractResolver.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Serialization; 2 | 3 | namespace ACMESharp.JSON 4 | { 5 | public class AcmeJsonContractResolver : CamelCasePropertyNamesContractResolver // DefaultContractResolver 6 | { 7 | protected override string ResolvePropertyName(string propertyName) 8 | { 9 | var propName = base.ResolvePropertyName(propertyName); 10 | if (!string.IsNullOrWhiteSpace(propName) && char.IsUpper(propName[0])) 11 | { 12 | var propNameChars = propName.ToCharArray(); 13 | propNameChars[0] = char.ToLower(propNameChars[0]); 14 | propName = new string(propNameChars); 15 | } 16 | 17 | return propName; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/AnswerDnsChallengeRequest.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class AnswerDnsChallengeRequest : RequestMessage 4 | { 5 | public AnswerDnsChallengeRequest() : base("challenge") 6 | { } 7 | 8 | public string KeyAuthorization 9 | { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/AnswerHttpChallengeRequest.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class AnswerHttpChallengeRequest : RequestMessage 4 | { 5 | public AnswerHttpChallengeRequest() : base("challenge") 6 | { } 7 | 8 | public string KeyAuthorization 9 | { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/AuthzStatusResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ACMESharp.Messages 5 | { 6 | public class AuthzStatusResponse 7 | { 8 | public string Status 9 | { get; set; } 10 | 11 | public DateTime? Expires 12 | { get; set; } 13 | 14 | public IdentifierPart Identifier 15 | { get; set; } 16 | 17 | public IEnumerable Challenges 18 | { get; set; } 19 | 20 | public IEnumerable> Combinations 21 | { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/IdentifierPart.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class IdentifierPart 4 | { 5 | public string Type 6 | { get; set; } 7 | 8 | public string Value 9 | { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/NewAuthzRequest.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class NewAuthzRequest : RequestMessage 4 | { 5 | public NewAuthzRequest() : base("new-authz") 6 | { } 7 | 8 | public IdentifierPart Identifier 9 | { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/NewAuthzResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ACMESharp.Messages 5 | { 6 | public class NewAuthzResponse 7 | { 8 | public string Status 9 | { get; set; } 10 | 11 | public DateTime? Expires 12 | { get; set; } 13 | 14 | public IdentifierPart Identifier 15 | { get; set; } 16 | 17 | public IEnumerable Challenges 18 | { get; set; } 19 | 20 | public IEnumerable> Combinations 21 | { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/NewCertRequest.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class NewCertRequest : RequestMessage 4 | { 5 | public NewCertRequest() : base("new-cert") 6 | { } 7 | 8 | public string Csr 9 | { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/NewRegRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACMESharp.Messages 4 | { 5 | public class NewRegRequest : RequestMessage 6 | { 7 | public NewRegRequest() : base("new-reg") 8 | { } 9 | 10 | protected NewRegRequest(string resource) : base(resource) 11 | { } 12 | 13 | public IEnumerable Contact 14 | { get; set; } 15 | 16 | public string Agreement 17 | { get; set; } 18 | 19 | public string Authorizations 20 | { get; set; } 21 | 22 | public string Certificates 23 | { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/RegResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACMESharp.Messages 4 | { 5 | public class RegResponse 6 | { 7 | public object Key 8 | { get; set; } 9 | 10 | public IEnumerable Contact 11 | { get; set; } 12 | 13 | public string Agreement 14 | { get; set; } 15 | 16 | public string Authorizations 17 | { get; set; } 18 | 19 | public string Certificates 20 | { get; set; } 21 | 22 | public object RecoveryKey 23 | { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/RevokeCertRequest.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class RevokeCertRequest : RequestMessage 4 | { 5 | public RevokeCertRequest() : base(AcmeServerDirectory.RES_REVOKE_CERT) 6 | { } 7 | 8 | public string Certificate 9 | { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Messages/UpdateRegRequest.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Messages 2 | { 3 | public class UpdateRegRequest : NewRegRequest 4 | { 5 | public UpdateRegRequest() : base("reg") 6 | { } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/Crt.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.PKI 2 | { 3 | 4 | public class Crt 5 | { 6 | public string Pem 7 | { get; set; } 8 | 9 | public enum MessageDigest 10 | { 11 | SHA256 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/CsrDetails.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACMESharp.PKI 4 | { 5 | 6 | public class CsrDetails 7 | { 8 | /// X509 'CN' 9 | public string CommonName { get; set; } 10 | 11 | // X509 SAN extension 12 | public IEnumerable AlternativeNames { get; set; } 13 | 14 | /// X509 'C' 15 | public string Country { get; set; } 16 | 17 | /// X509 'ST' 18 | public string StateOrProvince { get; set; } 19 | 20 | /// X509 'L' 21 | public string Locality { get; set; } 22 | 23 | /// X509 'O' 24 | public string Organization { get; set; } 25 | 26 | /// X509 'OU' 27 | public string OrganizationUnit { get; set; } 28 | 29 | /// X509 'D' 30 | public string Description { get; set; } 31 | 32 | /// X509 'S' 33 | public string Surname { get; set; } 34 | 35 | /// X509 'G' 36 | public string GivenName { get; set; } 37 | 38 | /// X509 'I' 39 | public string Initials { get; set; } 40 | 41 | /// X509 'T' 42 | public string Title { get; set; } 43 | 44 | /// X509 'SN' 45 | public string SerialNumber { get; set; } 46 | 47 | /// X509 'UID' 48 | public string UniqueIdentifier { get; set; } 49 | 50 | /// X509 'emailAddress' 51 | public string Email { get; set; } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/CsrParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACMESharp.PKI 4 | { 5 | public class CsrParams 6 | { 7 | public CsrDetails Details 8 | { get; set; } 9 | 10 | public DateTime? NotBefore 11 | { get; set; } 12 | 13 | public DateTime? NotAfter 14 | { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/EC/EcPrivateKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.EC 8 | { 9 | public class EcKeyPair : PrivateKey 10 | { } 11 | } 12 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/EC/EcPrivateKeyParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.EC 8 | { 9 | /// 10 | /// Defines the parameters that may be provided as input to generate 11 | /// an . 12 | /// 13 | public class EcPrivateKeyParams : PrivateKeyParams 14 | { 15 | /// 16 | /// The EC curve to use, using NIST curve names such as "P-256". 17 | /// 18 | public string CurveName 19 | { get; set; } = "P-256"; 20 | 21 | public bool NamedCurveEncoding 22 | { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/IPkiToolProvider.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.PKI 9 | { 10 | /// 11 | /// Defines the provider interface need to support discovery 12 | /// and instance-creation of a 13 | /// 14 | public interface IPkiToolProvider 15 | { 16 | IEnumerable DescribeParameters(); 17 | 18 | IPkiTool GetPkiTool(IReadOnlyDictionary initParams); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/IPkiToolProviderInfo.cs: -------------------------------------------------------------------------------- 1 | using ACMESharp.Ext; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.PKI 9 | { 10 | public interface IPkiToolProviderInfo : IAliasesSupported 11 | { 12 | string Name 13 | { get; } 14 | 15 | string Label 16 | { get; } 17 | 18 | string Description 19 | { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/PkiFormats.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.PKI 2 | { 3 | public enum EncodingFormat 4 | { 5 | /// 6 | /// Format encoding suitable for human-friendly printing. 7 | /// 8 | PRINT = 0, 9 | 10 | /// 11 | /// PEM text encoding. 12 | /// 13 | PEM = 1, 14 | 15 | /// 16 | /// DER binary encoding. 17 | /// 18 | DER = 2, 19 | } 20 | 21 | public enum ArchiveFormat 22 | { 23 | /// 24 | /// The PCKS#12 (.PFX) format. 25 | /// 26 | PKCS12 = 3, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/PkiToolProviderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ACMESharp.PKI 9 | { 10 | [MetadataAttribute] 11 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 12 | public class PkiToolProviderAttribute : ExportAttribute 13 | { 14 | public PkiToolProviderAttribute(string name) 15 | : base(typeof(IPkiToolProvider)) 16 | { 17 | Name = name; 18 | } 19 | 20 | public string Name 21 | { get; private set; } 22 | 23 | public string[] Aliases 24 | { get; set; } 25 | 26 | public string Label 27 | { get; set; } 28 | 29 | public string Description 30 | { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/PrivateKey.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.PKI 2 | { 3 | public abstract class PrivateKeyParams 4 | { } 5 | 6 | public abstract class PrivateKey 7 | { } 8 | } 9 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/RSA/RsaPrivateKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.RSA 8 | { 9 | public class RsaPrivateKey : PrivateKey 10 | { 11 | public RsaPrivateKey(int bits, string e, string pem) 12 | { 13 | Bits = bits; 14 | E = e; 15 | Pem = pem; 16 | } 17 | 18 | public int Bits 19 | { get; private set; } 20 | 21 | public string E 22 | { get; private set; } 23 | 24 | public object BigNumber 25 | { get; set; } 26 | 27 | public string Pem 28 | { get; private set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/PKI/RSA/RsaPrivateKeyParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.PKI.RSA 8 | { 9 | /// 10 | /// Defines the parameters that may be provided as input to generate 11 | /// an . 12 | /// 13 | public class RsaPrivateKeyParams : PrivateKeyParams 14 | { 15 | public delegate int RsaKeyGeneratorCallback(int p, int n, object cbArg); 16 | 17 | /// 18 | /// The number of bits in the generated key. If not specified 2048 is used. 19 | /// 20 | public int NumBits 21 | { get; set; } 22 | 23 | /// 24 | /// The RSA public exponent value. This can be a large decimal or hexadecimal value 25 | /// if preceded by 0x. Default value is 65537. 26 | /// 27 | public string PubExp 28 | { get; set; } 29 | 30 | public RsaKeyGeneratorCallback Callback 31 | { get; set; } 32 | 33 | public object CallbackArg 34 | { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ACMESharp client library")] 9 | [assembly: AssemblyDescription("ACME protocol client library for .NET.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | ///////////////////////////////////////////////////////////////// 14 | // Additional "shared" assembly-level attributes are defined in 15 | // SharedAssemblyInfo.cs and SharedAssemblyVersionInfo.cs files 16 | ///////////////////////////////////////////////////////////////// 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("d551234b-0a8d-4dee-8178-a81998df0edb")] 25 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/RequestMessage.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp 2 | { 3 | public abstract class RequestMessage 4 | { 5 | protected RequestMessage(string resource) 6 | { 7 | Resource = resource; 8 | } 9 | public string Resource 10 | { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Util/BaseManualProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ACMESharp.Util 5 | { 6 | public abstract class BaseManualProvider 7 | { 8 | public const string STD_OUT = "OUT"; 9 | public const string STD_ERR = "ERR"; 10 | 11 | protected string _WriteOutPath = STD_OUT; 12 | protected TextWriter _writer = Console.Out; 13 | 14 | public string WriteOutPath 15 | { 16 | get { return _WriteOutPath; } 17 | set 18 | { 19 | TextWriter newWriter = null; 20 | 21 | if (string.IsNullOrEmpty(value) || value == STD_OUT) 22 | newWriter = Console.Out; 23 | else if (value == STD_ERR) 24 | newWriter = Console.Error; 25 | else 26 | { 27 | newWriter = new StreamWriter(_WriteOutPath, true); 28 | } 29 | 30 | if (_writer != null && newWriter != _writer 31 | && _writer != Console.Out && _writer != Console.Error) 32 | { 33 | _writer.Close(); 34 | } 35 | _writer = newWriter; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Util/ExceptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACMESharp.Util 8 | { 9 | public static class ExceptionExtensions 10 | { 11 | public static Exception With(this Exception ex, string key, object val) 12 | { 13 | ex.Data[key] = val; 14 | return ex; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Util/StringHelper.cs: -------------------------------------------------------------------------------- 1 | namespace ACMESharp.Util 2 | { 3 | public static class StringHelper 4 | { 5 | public static string IfNullOrEmpty(string s, string v1 = null) 6 | { 7 | if (string.IsNullOrEmpty(s)) 8 | return v1; 9 | return s; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Util/SysHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Principal; 3 | 4 | namespace ACMESharp.Util 5 | { 6 | public class SysHelper 7 | { 8 | /// 9 | /// Resolves if the current process is executing with elevated privileges. 10 | /// 11 | /// 12 | /// A little help from: http://stackoverflow.com/a/1089061 13 | /// 14 | public static bool IsElevatedAdmin() 15 | { 16 | // Assume false unless we successfully resolve the true status 17 | bool isElevatedAdmin = false; 18 | try 19 | { 20 | // Get currently logged-in user 21 | using (var user = WindowsIdentity.GetCurrent()) 22 | { 23 | isElevatedAdmin = new WindowsPrincipal(user) 24 | .IsInRole(WindowsBuiltInRole.Administrator); 25 | } 26 | } 27 | catch (UnauthorizedAccessException) 28 | { 29 | // TODO: log or notify? 30 | } 31 | catch (Exception) 32 | { 33 | // TODO: log or notify? 34 | } 35 | 36 | return isElevatedAdmin; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/Util/TemporaryFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ACMESharp.Util 5 | { 6 | /// 7 | /// Wrapper for GetTempFileName, which deletes the file when it's disposed 8 | /// 9 | public sealed class TemporaryFile : IDisposable 10 | { 11 | public TemporaryFile() 12 | { 13 | FileName = Path.GetTempFileName(); 14 | } 15 | 16 | public void Dispose() 17 | { 18 | File.Delete(FileName); 19 | } 20 | 21 | public string FileName { get; } 22 | } 23 | } -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/WebServer/IWebServerProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ACMESharp.WebServer 5 | { 6 | public interface XXXIWebServerProvider 7 | { 8 | void UploadFile(Uri fileUrl, Stream s); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/WebServer/IisSitePathProvider-WebConfig: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/WebServer/ManualWebServerProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using ACMESharp.Util; 4 | 5 | namespace ACMESharp.WebServer 6 | { 7 | public class ManualWebServerProvider : BaseManualProvider, XXXIWebServerProvider 8 | { 9 | public string FilePath 10 | { get; set; } 11 | 12 | public void UploadFile(Uri fileUrl, Stream s) 13 | { 14 | var path = FilePath; 15 | 16 | if (string.IsNullOrEmpty(path)) 17 | path = Path.GetTempFileName(); 18 | else 19 | { 20 | int index = 0; 21 | while (File.Exists(path)) 22 | path = string.Format("{0}.{1}", FilePath, ++index); 23 | } 24 | 25 | var dir = Path.GetDirectoryName(path); 26 | if (!Directory.Exists(dir)) 27 | throw new DirectoryNotFoundException("Missing folder in requested file path"); 28 | 29 | using (var fs = new FileStream(path, FileMode.CreateNew)) 30 | { 31 | s.CopyTo(fs); 32 | } 33 | 34 | _writer.WriteLine("Manually Upload Web Server File:"); 35 | _writer.WriteLine(" * URL: [{0}]", fileUrl); 36 | _writer.WriteLine(" * File Content: [{0}]", path); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/WebServer/WebServerInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace ACMESharp.WebServer 4 | { 5 | public class WebServerInfo 6 | { 7 | // TOOD: this is repeated from DnsInfo, clean this up! 8 | private static Newtonsoft.Json.JsonSerializerSettings JSS = 9 | new Newtonsoft.Json.JsonSerializerSettings 10 | { 11 | Formatting = Newtonsoft.Json.Formatting.Indented, 12 | TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto, 13 | }; 14 | 15 | public XXXIWebServerProvider Provider 16 | { get; set; } 17 | 18 | public void Save(System.IO.Stream s) 19 | { 20 | using (var w = new System.IO.StreamWriter(s)) 21 | { 22 | w.Write(Newtonsoft.Json.JsonConvert.SerializeObject(this, JSS)); 23 | } 24 | } 25 | 26 | public string Save() 27 | { 28 | using (var w = new System.IO.MemoryStream()) 29 | { 30 | Save(w); 31 | return Encoding.UTF8.GetString(w.ToArray()); 32 | } 33 | } 34 | 35 | public static WebServerInfo Load(System.IO.Stream s) 36 | { 37 | using (var r = new System.IO.StreamReader(s)) 38 | { 39 | return Newtonsoft.Json.JsonConvert.DeserializeObject( 40 | r.ReadToEnd(), JSS); 41 | } 42 | } 43 | 44 | public static WebServerInfo Load(string json) 45 | { 46 | using (var r = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(json))) 47 | { 48 | return Load(r); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ACMESharp/ACMESharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ACMESharp/nuget-build.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SETLOCAL 3 | 4 | ECHO. 5 | 6 | SET THIS=%0 7 | SET THIS_DIR=%~dp0 8 | 9 | SET PRJ_ARG=%1 10 | IF NOT "%PRJ_ARG%"=="" GOTO :found_prj_arg 11 | ECHO *** MISSING PROJECT NAME ARGUMENT!!! *** 12 | GOTO :eof 13 | :found_prj_arg 14 | 15 | @REM Collect any surplus arguments 16 | SET NUGET_ARGS= 17 | :next_collect_args 18 | SHIFT 19 | IF "%1"=="" GOTO :end_collect_args 20 | SET NUGET_ARGS=%NUGET_ARGS% %1 21 | GOTO :next_collect_args 22 | :end_collect_args 23 | 24 | SET BUILDNO=%APPVEYOR_BUILD_NUMBER% 25 | IF "%BUILDNO%"=="" SET BUILDNO=0 26 | 27 | ECHO Building %PRJ_ARG% (build #%BUILDNO%) 28 | 29 | REM --- Try to find NuGet on the path 30 | FOR /F "delims=" %%i IN ('where nuget /F') DO set NUGET=%%i 31 | 32 | REM --- If not found, look for NuGet at fixed location (in AppVeyor) 33 | ECHO NUGET=%NUGET% 34 | IF NOT EXIST "%NUGET%" SET NUGET=%THIS_DIR%..\..\..\nuget\nuget.exe 35 | IF NOT EXIST "%NUGET%" ( 36 | ECHO --^> ERROR: Cannot Find Nuget: Please ensure Nuget is installed and available on your path 37 | ECHO. 38 | GOTO :eof 39 | ) 40 | 41 | SET NUGET=%NUGET:"=% 42 | ECHO Using NuGet located at %NUGET% 43 | 44 | SET NUGET_PRJ="%THIS_DIR%%PRJ_ARG%\%PRJ_ARG%.csproj" 45 | SET NUGET_OUT="%THIS_DIR%%PRJ_ARG%\bin\nuget" 46 | 47 | IF NOT EXIST %NUGET_OUT% MD %NUGET_OUT% 48 | 49 | SET NUGET_PROPS=nugetCwd=%CD% 50 | SET NUGET_PROPS=%NUGET_PROPS%;nugetDate=%DATE% 51 | SET NUGET_PROPS=%NUGET_PROPS%;nugetTime=%Time% 52 | SET NUGET_PROPS=%NUGET_PROPS%;buildNum=%BUILDNO% 53 | 54 | @REM We used to append the '-EA' suffix to the version which caused NuGet.org to flag it as 55 | @REM PRERELEASE, but now that we're stable enough, I think it's safe to remove this caution 56 | @REM SET NUGET_PROPS=%NUGET_PROPS%;versionLabel=-EA 57 | 58 | :Execute_NuGet 59 | ECHO ********************* 60 | ECHO ** Executing NuGet: %NUGET% pack -Properties "%NUGET_PROPS%" -OutputDirectory %NUGET_OUT% %NUGET_PRJ% %NUGET_ARGS% 61 | ECHO ********************* 62 | "%NUGET%" pack -Properties "%NUGET_PROPS%" -OutputDirectory %NUGET_OUT% %NUGET_PRJ% %NUGET_ARGS% 63 | 64 | ECHO. -------------------------------------------------------------------------------- /ACMESharp/shared/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyCompany("github.com/ebekker/ACMESharp")] 9 | [assembly: AssemblyProduct("ACMESharp")] 10 | [assembly: AssemblyCopyright("Copyright © " + ASMINFO.COPYRIGHT_YEAR + " Eugene Bekker. All rights reserved.")] 11 | [assembly: AssemblyTrademark("")] 12 | -------------------------------------------------------------------------------- /ACMESharp/shared/SharedAssemblyVersionInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // Version information for an assembly consists of the following four values: 4 | // 5 | // Major Version 6 | // Minor Version 7 | // Patch Number 8 | // Build Number 9 | // 10 | // You can specify all the values or you can default the Build and Revision Numbers 11 | // by using the '*' as shown below: 12 | // [assembly: AssemblyVersion("1.0.*")] 13 | [assembly: AssemblyVersion(ASMINFO.VERSION + ".0")] 14 | [assembly: AssemblyFileVersion(ASMINFO.VERSION + ".0")] 15 | 16 | // This is used for the NuSpec version tag replacement 17 | // and is combined with nuget-specific rev and release 18 | [assembly: AssemblyInformationalVersion(ASMINFO.VERSION)] 19 | 20 | // ReSharper disable once InconsistentNaming 21 | internal static class ASMINFO 22 | { 23 | 24 | // DON'T FORGET TO UPDATE APPVEYOR.YML 25 | // ReSharper disable once InconsistentNaming 26 | public const string VERSION = "0.9.3"; 27 | public const string COPYRIGHT_YEAR = "2017"; 28 | } 29 | -------------------------------------------------------------------------------- /ACMESharp/shared/SharedGlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 |  2 | // This file is used by Code Analysis to maintain SuppressMessage 3 | // attributes that are applied to this project. 4 | // Project-level suppressions either have no target or are given 5 | // a specific target and scoped to a namespace, type, member, etc. 6 | 7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( 8 | "Redundancies in Code", "RECS0113:Redundant comma in array initializer", 9 | Justification = "Personal Preference in Coding Style")] -------------------------------------------------------------------------------- /artwork/ACMESharp-logo-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo-square.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo-square64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo-square64.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo-transparent.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo128-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo128-transparent.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo128.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo64-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo64-transparent.png -------------------------------------------------------------------------------- /artwork/ACMESharp-logo64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp-logo64.png -------------------------------------------------------------------------------- /artwork/ACMESharp1.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/artwork/ACMESharp1.vsdx -------------------------------------------------------------------------------- /cSpell.json: -------------------------------------------------------------------------------- 1 | // cSpell Settings 2 | { 3 | // Version of the setting file. Always 0.1 4 | "version": "0.1", 5 | // language - current active spelling language 6 | "language": "en", 7 | // words - list of words to be always considered correct 8 | "words": [ 9 | "interoperate" 10 | ], 11 | // flagWords - list of words to be always considered incorrect 12 | // This is useful for offensive words and common spelling errors. 13 | // For example "hte" should be "the" 14 | "flagWords": [ 15 | "hte" 16 | ] 17 | } -------------------------------------------------------------------------------- /ci/av-onfinish.ps1: -------------------------------------------------------------------------------- 1 | ## Check if we should Enable RDP access 2 | if ([int]$((Resolve-DnsName blockrdp.ci.acmesharp.bkkr.us -Type TXT).Text)) { 3 | Write-Warning "Detected RDP access request" 4 | ## As per: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ 5 | $blockRdp = $true 6 | iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) 7 | } 8 | else { 9 | Write-Output "No RDP access requested" 10 | } 11 | -------------------------------------------------------------------------------- /ci/nuget-staging/AWSPowerShell/README.md: -------------------------------------------------------------------------------- 1 | This is a "fake" manifest-only, POSH module version of the [real](https://www.powershellgallery.com/packages/AWSPowerShell) AWSPowerShell module. 2 | 3 | The purpose of this module is to satisfy dependencies such as `RequiredModules` defined by the manifest of other modules that could be published to nuget repos such as staging. 4 | -------------------------------------------------------------------------------- /ci/psorg/PS4-Step0.ps1: -------------------------------------------------------------------------------- 1 | ## We need to make sure IIS is installed to test the IIS providers 2 | if ($PSVersionTable.PSVersion.Major -ge 4) { 3 | ## Works for PS 4 & 5 4 | Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature -IncludeManagementTools 5 | } 6 | else { 7 | ## Works for PS 3 8 | Add-WindowsFeature -Name Web-Server -IncludeAllSubFeature 9 | } 10 | 11 | function Get-MyIP { 12 | $ipJson = Invoke-WebRequest -Uri https://api.ipify.org?format=json -UseBasicParsing | ConvertFrom-Json 13 | $ipJson.ip 14 | } 15 | $x = Get-MyIP 16 | Write-Host "My IP is $x" 17 | $x -------------------------------------------------------------------------------- /ci/psorg/PS4-Step1.ps1: -------------------------------------------------------------------------------- 1 | $coPath = '%system.teamcity.build.checkoutDir%' 2 | 3 | function Unzip-File { 4 | param( 5 | [string]$Zip, 6 | [string]$Dir 7 | ) 8 | 9 | ## Extract the ZIP (based on http://serverfault.com/a/201604) 10 | $shellApp = New-Object -ComObject shell.application 11 | $zipFile = $shellApp.namespace($Zip) 12 | mkdir $Dir 13 | $shellApp.namespace($Dir).Copyhere($zipFile.items()) 14 | } 15 | 16 | 17 | ## Retrieve the PS Pester tests from S3 18 | $avFileUri = "https://ci.appveyor.com/api/projects/ebekker/acmesharp/artifacts/ACMESharp/ACMESharp.POSH-test/ACME-posh-pester.zip" 19 | $zipFilePath = "$coPath\ACME-posh-pester.zip" 20 | $destDir = "$coPath\ACME-posh-pester" 21 | 22 | Invoke-WebRequest -Uri $avFileUri -OutFile $zipFilePath 23 | Unblock-File -Path $zipFilePath 24 | Unzip-File -Zip $zipFilePath -Dir $destDir 25 | 26 | ## Retrieve the PS Pester binaries from S3 27 | $avFileUri = "https://ci.appveyor.com/api/projects/ebekker/acmesharp/artifacts/ACMESharp/ACMESharp.POSH-test/ACME-posh-pester-bin.zip" 28 | $zipFilePath = "$coPath\ACME-posh-pester-bin.zip" 29 | $destDir = "$coPath\ACME-posh-pester" 30 | 31 | Invoke-WebRequest -Uri $avFileUri -OutFile $zipFilePath 32 | Unblock-File -Path $zipFilePath 33 | Unzip-File -Zip $zipFilePath -Dir $destDir 34 | -------------------------------------------------------------------------------- /ci/psorg/PS4-Step2.ps1: -------------------------------------------------------------------------------- 1 | ## Set these up which are used by AWS PS calls during the Pester tests below 2 | $env:AWS_ACCESS_KEY_ID = '%iamAccessKey%' 3 | $env:AWS_SECRET_ACCESS_KEY = '%iamSecretKey%' 4 | 5 | try { 6 | $coPath = '%system.teamcity.build.checkoutDir%' 7 | 8 | ## This EnvVar is looked for by the Pester tests for ipmo 9 | #$ACME_POSH_PATH = "$coPath\ACME-posh\Debug\ACMESharp" 10 | $ACME_POSH_PATH = "$coPath\ACME-posh-pester\ACMESharp" 11 | 12 | Import-Module Pester -ErrorAction Stop 13 | 14 | $xml = Join-Path $coPath Test.v4.xml 15 | $result = Invoke-Pester -Path $coPath -OutputFile $xml -OutputFormat NUnitXml -PassThru -Strict -ErrorAction Stop 16 | 17 | if ($result.FailedCount -gt 0) { 18 | throw "$($result.FailedCount) tests did not pass." 19 | } 20 | } 21 | catch { 22 | Write-Error -ErrorRecord $_ 23 | exit 1 24 | } -------------------------------------------------------------------------------- /ci/version-bump.md: -------------------------------------------------------------------------------- 1 | 2 | Locations that need to be updated with every version bump: 3 | * `/appveyor.yml` 4 | * `/ACMESharp/shared/SharedAssemblyVersionInfo.cs` 5 | * `/ACMESharp/ACMESharp.POSH/ACMESharp.psd1` -- `ModuleVersion` 6 | * `/ACMESharp/ACMESharp.Providers.AWS /ACMESharp.Providers.*.psd1` -- `ModuleVersion` 7 | * `/ACMESharp/ACMESharp.Providers.CloudFlare /ACMESharp.Providers.*.psd1` -- `ModuleVersion` 8 | * `/ACMESharp/ACMESharp.Providers.IIS /ACMESharp.Providers.*.psd1` -- `ModuleVersion` 9 | * `/ACMESharp/ACMESharp.Providers.Windows /ACMESharp.Providers.*.psd1` -- `ModuleVersion` 10 | 11 | NO LONGER MAINTAINED - choco not supported 12 | * `/ACMESharp/ACMESharp.POSH/choco/acmesharp-posh/acmesharp-posh-ea.nuspec` -- `` 13 | * `/ACMESharp/ACMESharp/ACMESharp.POSH-test/choco/acmesharp-posh-all/acmesharp-posh-all.nuspec` -- `` 14 | 15 | ~~Child Projects that have their own version files~~: (no longer true till after 1.0 release) 16 | * `/ACMESharp/ACMESharp.Vault/Properties/AssemblyInfo.cs` 17 | * `/ACMESharp/ACMESharp.Providers.AWS/Properties/AssemblyInfo.cs` 18 | * `/ACMESharp/ACMESharp.Providers.CloudFlare/Properties/AssemblyInfo.cs` 19 | * `/ACMESharp/ACMESharp.Providers.IIS/Properties/AssemblyInfo.cs` 20 | * `/ACMESharp/ACMESharp.Providers.Windows/Properties/AssemblyInfo.cs` 21 | 22 | 23 | Building nuget packages with minor revisions 24 | * `/ACMESharp/nuget-build.cmd` 25 | * `/ACMESharp/nuget-build.cmd 3` 26 | -------------------------------------------------------------------------------- /tools/XmlDoc2CmdletDoc/Jolt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/tools/XmlDoc2CmdletDoc/Jolt.dll -------------------------------------------------------------------------------- /tools/XmlDoc2CmdletDoc/System.Management.Automation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/tools/XmlDoc2CmdletDoc/System.Management.Automation.dll -------------------------------------------------------------------------------- /tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.Core.dll -------------------------------------------------------------------------------- /tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.exe -------------------------------------------------------------------------------- /tools/appveyor-connect.ps1: -------------------------------------------------------------------------------- 1 |  2 | $ign = "$PSScriptRoot\_IGNORE" 3 | md $ign -Force | Out-Null 4 | 5 | $rdpTemplate = "$PSScriptRoot\appveyor-connect.template.rdp" 6 | $rdpLastServer = "$ign\lastServer.txt" 7 | $rdpProfile = "$ign\appveyor.rdp" 8 | 9 | #$avDetails = @' 10 | # Server: 74.205.54.20:33931 11 | # Username: appveyor 12 | # Password: %KFGJzhKUlcD$jX 13 | #'@ 14 | $avDetails = Get-Clipboard -TextFormatType Text 15 | if (-not $avDetails -or -not "$avDetails".Trim().Length) { 16 | Write-Warning "Copy the connection details from AV console to the clipboard and TRY AGAIN!" 17 | return 18 | } 19 | 20 | $hostport = "" 21 | $username = "" 22 | $password = "" 23 | 24 | if ("$avDetails" -imatch "server:\s*([^\s]+)" ) { $hostport = $Matches[1] } 25 | if ("$avDetails" -imatch "username:\s*([^\s]+)") { $username = $Matches[1] } 26 | if ("$avDetails" -imatch "password:\s*([^\s]+)") { $password = $Matches[1] } 27 | 28 | Write-Output @" 29 | Extracted Connection Details: 30 | Server: $hostport 31 | Username: $username 32 | Password: $password 33 | "@ 34 | 35 | if (-not $hostport -or -not $username -or -not $password) { 36 | Write-Warning "Unable to extract all the connection details" 37 | return 38 | } 39 | 40 | if (Test-Path -PathType Leaf $rdpLastServer) { 41 | $lastServer = [System.IO.File]::ReadAllText($rdpLastServer) 42 | Write-Warning "Detected LAST SERVER [$lastServer]" 43 | if ($lastServer) { 44 | Write-Warning "Deleting Credentials for LAST SERVER [$lastServer]" 45 | cmdkey /delete:`"$lastServer`" 46 | } 47 | } 48 | 49 | [System.IO.File]::WriteAllText($rdpLastServer, $hostport) 50 | 51 | $rdpDetails = [System.IO.File]::ReadAllText($rdpTemplate) 52 | $rdpDetails = $rdpDetails.Replace("@@SERVER@@", $hostport) 53 | [System.IO.File]::WriteAllText($rdpProfile, $rdpDetails) 54 | 55 | 56 | Write-Warning "Adding Credentials for [$hostport]" 57 | cmdkey /generic:`"$hostport`" /user:`"$username`" /pass:`"$password`" 58 | 59 | Write-Output "COPYING PASSWORD TO CLIPBOARD" 60 | Set-Clipboard -Value $password 61 | 62 | mstsc $rdpProfile 63 | -------------------------------------------------------------------------------- /tools/appveyor-connect.template.rdp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebekker/ACMESharp/75baad7ffec2506779e477caa029facdb8b8b822/tools/appveyor-connect.template.rdp --------------------------------------------------------------------------------