Beispiel #1
0
        public async Task CertificateCache_JWK_RS256(string certificateLocation)
        {
            var certCache = new CertificateCache();

            var certificates = await certCache.GetCertificatesAsync(certificateLocation, FromKeyToRsa, false, default);

            Assert.NotEmpty(certificates);
        }
Beispiel #2
0
        public async Task CertificateCache_NonJWK_Error()
        {
            var certCache = new CertificateCache();

            var exception = await Assert.ThrowsAsync <ArgumentException>(() => certCache.GetCertificatesAsync(
                                                                             "https://www.googleapis.com/service_accounts/v1/metadata/x509/[email protected]", json => RSA.Create(), false, default));

            Assert.Contains("Only JWK formatted keys are currently supported", exception.Message);
        }
        public async Task CertificateCache()
        {
            var certCache = new CertificateCache();

            // We don't care about cert transformation here, that'll be tested when verifying.
            var certificates = await certCache.GetCertificatesAsync(GoogleAuthConsts.JsonWebKeySetUrl, json => RSA.Create(), false, default);

            Assert.NotEmpty(certificates);
        }