internal static EncryptionInstructions GenerateInstructionsForNonKmsMaterialsV2()

in src/EncryptionUtilsV2.cs [133:148]


        internal static EncryptionInstructions GenerateInstructionsForNonKmsMaterialsV2(EncryptionMaterialsV2 materials)
        {
            // Generate the IV and key, and encrypt the key locally.
            if (materials.AsymmetricProvider != null)
            {
                return EncryptEnvelopeKeyUsingAsymmetricKeyPairV2(materials);
            }

            if (materials.SymmetricProvider != null)
            {
                return EncryptEnvelopeKeyUsingSymmetricKeyV2(materials);
            }

            throw new ArgumentException("Error generating encryption instructions. " +
                                        "EncryptionMaterials must have the AsymmetricProvider or SymmetricProvider set.");
        }