Ejemplo n.º 1
0
        public UriSigningKey(string keyId, KeyVaultSigningKeyDefinition keySourceParameters)
        {
            if (keyId == null)
            {
                throw new ArgumentNullException(nameof(keyId));
            }
            if (keySourceParameters == null)
            {
                throw new ArgumentNullException(nameof(keySourceParameters));
            }

            KeyId = keyId;
            KeySourceParameters = keySourceParameters;
        }
Ejemplo n.º 2
0
        internal static UriSigningKey DeserializeUriSigningKey(JsonElement element)
        {
            string keyId = default;
            KeyVaultSigningKeyDefinition keySourceParameters = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("keyId"))
                {
                    keyId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("keySourceParameters"))
                {
                    keySourceParameters = KeyVaultSigningKeyDefinition.DeserializeKeyVaultSigningKeyDefinition(property.Value);
                    continue;
                }
            }
            return(new UriSigningKey(keyId, keySourceParameters));
        }