public void FromPemFormat_FromBase64Der_BothCertsConvertedCorrectly()
        {
            var cert1 = CertificateUtilities.FromPemFormat(Constants.SchemeOwner.PublicKey);
            var cert2 = CertificateUtilities.FromBase64Der(Constants.SchemeOwner.PublicKeyBase64Der);

            var sha1 = cert1.GetSha256();
            var sha2 = cert2.GetSha256();

            sha1.Should().Be(sha2);
        }
 private static CertificateValidationArgs CreateValidArgs()
 {
     return(new CertificateValidationArgs(
                CertificateUtilities.FromPemFormat(Constants.AbcParty.PublicKey),
                Constants.AbcParty.ClientId,
                new[]
     {
         CertificateUtilities.FromPemFormat(Constants.TestCertificateAuthority.IntermediateCaPublicKey),
         CertificateUtilities.FromPemFormat(Constants.TestCertificateAuthority.RootCaPublicKey)
     }));
 }
        public async Task IsValidAsync_ChainInvalid_ReturnsFalse()
        {
            var args = new CertificateValidationArgs(
                CertificateUtilities.FromPemFormat(Constants.AbcParty.PublicKey),
                Constants.AbcParty.ClientId,
                new[] { CertificateUtilities.FromPemFormat(RandomCaPublicKey) });

            var result = await _sut.IsValidAsync(args, "access_token_which_wont_be_used_here");

            result.Should().BeFalse();
        }