Example #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));
        }
        public KeyVaultAndKeyReference(SourceVault sourceVault, string keyUrl)
        {
            if (sourceVault == null)
            {
                throw new ArgumentNullException(nameof(sourceVault));
            }
            if (keyUrl == null)
            {
                throw new ArgumentNullException(nameof(keyUrl));
            }

            SourceVault = sourceVault;
            KeyUrl      = keyUrl;
        }
        public KeyVaultAndSecretReference(SourceVault sourceVault, string secretUrl)
        {
            if (sourceVault == null)
            {
                throw new ArgumentNullException(nameof(sourceVault));
            }
            if (secretUrl == null)
            {
                throw new ArgumentNullException(nameof(secretUrl));
            }

            SourceVault = sourceVault;
            SecretUrl   = secretUrl;
        }
Example #4
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));
        }
 internal KeyForDiskEncryptionSet(SourceVault sourceVault, string keyUrl)
 {
     SourceVault = sourceVault;
     KeyUrl      = keyUrl;
 }