Ejemplo n.º 1
0
        internal static KeyForDiskEncryptionSet DeserializeKeyForDiskEncryptionSet(JsonElement element)
        {
            Optional <SourceVault> sourceVault = default;
            string keyUrl = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sourceVault"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sourceVault = SourceVault.DeserializeSourceVault(property.Value);
                    continue;
                }
                if (property.NameEquals("keyUrl"))
                {
                    keyUrl = property.Value.GetString();
                    continue;
                }
            }
            return(new KeyForDiskEncryptionSet(sourceVault.Value, keyUrl));
        }
Ejemplo n.º 2
0
        internal static KeyVaultAndKeyReference DeserializeKeyVaultAndKeyReference(JsonElement element)
        {
            SourceVault sourceVault = default;
            string      keyUrl      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sourceVault"))
                {
                    sourceVault = SourceVault.DeserializeSourceVault(property.Value);
                    continue;
                }
                if (property.NameEquals("keyUrl"))
                {
                    keyUrl = property.Value.GetString();
                    continue;
                }
            }
            return(new KeyVaultAndKeyReference(sourceVault, keyUrl));
        }