11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License.
33
4+ using System ;
45using System . ComponentModel ;
56using Azure . Security . KeyVault . Keys . Cryptography ;
67
@@ -12,12 +13,27 @@ namespace Azure.Security.KeyVault.Keys
1213 public static class CryptographyModelFactory
1314 {
1415 /// <summary>
15- /// Initializes a new instance of the <see cref="Cryptography.DecryptResult"/> for mocking purposes.
16+ /// Initializes a new instance of the <see cref="Cryptography.DecryptOptions"/> class for mocking purposes.
17+ /// </summary>
18+ /// <param name="algorithm">Sets the <see cref="DecryptOptions.Algorithm"/> property.</param>
19+ /// <param name="ciphertext">Sets the <see cref="DecryptOptions.Ciphertext"/> property.</param>
20+ /// <param name="iv">Sets the <see cref="DecryptOptions.Iv"/> property.</param>
21+ /// <param name="authenticationTag">Sets the <see cref="DecryptOptions.AuthenticationTag"/> property.</param>
22+ /// <returns>A new instance of the <see cref="Cryptography.DecryptOptions"/> class for mocking purposes.</returns>
23+ /// <exception cref="ArgumentNullException"><paramref name="ciphertext"/> is null.</exception>
24+ public static DecryptOptions DecryptOptions ( EncryptionAlgorithm algorithm , byte [ ] ciphertext , byte [ ] iv = default , byte [ ] authenticationTag = default ) => new DecryptOptions ( algorithm , ciphertext )
25+ {
26+ Iv = iv ,
27+ AuthenticationTag = authenticationTag ,
28+ } ;
29+
30+ /// <summary>
31+ /// Initializes a new instance of the <see cref="Cryptography.DecryptResult"/> class for mocking purposes.
1632 /// </summary>
1733 /// <param name="keyId">Sets the <see cref="DecryptResult.KeyId"/> property.</param>
1834 /// <param name="plaintext">Sets the <see cref="DecryptResult.Plaintext"/> property.</param>
1935 /// <param name="algorithm">Sets the <see cref="DecryptResult.Algorithm"/> property.</param>
20- /// <returns>A new instance of the <see cref="Cryptography.DecryptResult"/> for mocking purposes.</returns>
36+ /// <returns>A new instance of the <see cref="Cryptography.DecryptResult"/> class for mocking purposes.</returns>
2137 public static DecryptResult DecryptResult ( string keyId = default , byte [ ] plaintext = default , EncryptionAlgorithm algorithm = default ) => new DecryptResult
2238 {
2339 KeyId = keyId ,
@@ -26,25 +42,35 @@ public static class CryptographyModelFactory
2642 } ;
2743
2844 /// <summary>
29- /// Initializes a new instance of the <see cref="Cryptography.EncryptResult"/> for mocking purposes.
45+ /// Initializes a new instance of the <see cref="Cryptography.EncryptOptions"/> class for mocking purposes.
46+ /// </summary>
47+ /// <param name="algorithm">Sets the <see cref="EncryptOptions.Algorithm"/> property.</param>
48+ /// <param name="plaintext">Sets the <see cref="EncryptOptions.Plaintext"/> property.</param>
49+ /// <param name="iv">Sets the <see cref="DecryptOptions.Iv"/> property.</param>
50+ /// <returns>A new instance of the <see cref="Cryptography.EncryptOptions"/> class for mocking purposes.</returns>
51+ /// <exception cref="ArgumentNullException"><paramref name="plaintext"/> is null.</exception>
52+ public static EncryptOptions EncryptOptions ( EncryptionAlgorithm algorithm , byte [ ] plaintext , byte [ ] iv = default ) => new EncryptOptions ( algorithm , plaintext , iv , null ) ;
53+
54+ /// <summary>
55+ /// Initializes a new instance of the <see cref="Cryptography.EncryptResult"/> class for mocking purposes.
3056 /// </summary>
3157 /// <param name="keyId">Sets the <see cref="EncryptResult.KeyId"/> property.</param>
3258 /// <param name="ciphertext">Sets the <see cref="EncryptResult.Ciphertext"/> property.</param>
3359 /// <param name="algorithm">Sets the <see cref="EncryptResult.Algorithm"/> property.</param>
34- /// <returns>A new instance of the <see cref="Cryptography.EncryptResult"/> for mocking purposes.</returns>
60+ /// <returns>A new instance of the <see cref="Cryptography.EncryptResult"/> class for mocking purposes.</returns>
3561 [ EditorBrowsable ( EditorBrowsableState . Never ) ]
3662 public static EncryptResult EncryptResult ( string keyId , byte [ ] ciphertext , EncryptionAlgorithm algorithm ) => EncryptResult ( keyId , ciphertext , algorithm , null ) ;
3763
3864 /// <summary>
39- /// Initializes a new instance of the <see cref="Cryptography.EncryptResult"/> for mocking purposes.
65+ /// Initializes a new instance of the <see cref="Cryptography.EncryptResult"/> class for mocking purposes.
4066 /// </summary>
4167 /// <param name="keyId">Sets the <see cref="EncryptResult.KeyId"/> property.</param>
4268 /// <param name="ciphertext">Sets the <see cref="EncryptResult.Ciphertext"/> property.</param>
4369 /// <param name="algorithm">Sets the <see cref="EncryptResult.Algorithm"/> property.</param>
4470 /// <param name="iv">Sets the initialization vector for encryption.</param>
4571 /// <param name="authenticatedTag">Sets the authenticated tag resulting from encryption with a symmetric key using AES.</param>
4672 /// <param name="additionalAuthenticatedData">Sets additional data that is authenticated during decryption but not encrypted.</param>
47- /// <returns>A new instance of the <see cref="Cryptography.EncryptResult"/> for mocking purposes.</returns>
73+ /// <returns>A new instance of the <see cref="Cryptography.EncryptResult"/> class for mocking purposes.</returns>
4874 public static EncryptResult EncryptResult ( string keyId = default , byte [ ] ciphertext = default , EncryptionAlgorithm algorithm = default , byte [ ] iv = default , byte [ ] authenticatedTag = default , byte [ ] additionalAuthenticatedData = default ) => new EncryptResult
4975 {
5076 KeyId = keyId ,
@@ -56,12 +82,12 @@ public static class CryptographyModelFactory
5682 } ;
5783
5884 /// <summary>
59- /// Initializes a new instance of the <see cref="Cryptography.SignResult"/> for mocking purposes.
85+ /// Initializes a new instance of the <see cref="Cryptography.SignResult"/> class for mocking purposes.
6086 /// </summary>
6187 /// <param name="keyId">Sets the <see cref="SignResult.KeyId"/> property.</param>
6288 /// <param name="signature">Sets the <see cref="SignResult.Signature"/> property.</param>
6389 /// <param name="algorithm">Sets the <see cref="SignResult.Algorithm"/> property.</param>
64- /// <returns>A new instance of the <see cref="Cryptography.SignResult"/> for mocking purposes.</returns>
90+ /// <returns>A new instance of the <see cref="Cryptography.SignResult"/> class for mocking purposes.</returns>
6591 public static SignResult SignResult ( string keyId = default , byte [ ] signature = default , SignatureAlgorithm algorithm = default ) => new SignResult
6692 {
6793 KeyId = keyId ,
@@ -70,12 +96,12 @@ public static class CryptographyModelFactory
7096 } ;
7197
7298 /// <summary>
73- /// Initializes a new instance of the <see cref="Cryptography.UnwrapResult"/> for mocking purposes.
99+ /// Initializes a new instance of the <see cref="Cryptography.UnwrapResult"/> class for mocking purposes.
74100 /// </summary>
75101 /// <param name="keyId">Sets the <see cref="UnwrapResult.KeyId"/> property.</param>
76102 /// <param name="key">Sets the <see cref="UnwrapResult.Key"/> property.</param>
77103 /// <param name="algorithm">Sets the <see cref="UnwrapResult.Algorithm"/> property.</param>
78- /// <returns>A new instance of the <see cref="Cryptography.UnwrapResult"/> for mocking purposes.</returns>
104+ /// <returns>A new instance of the <see cref="Cryptography.UnwrapResult"/> class for mocking purposes.</returns>
79105 public static UnwrapResult UnwrapResult ( string keyId = default , byte [ ] key = default , KeyWrapAlgorithm algorithm = default ) => new UnwrapResult
80106 {
81107 KeyId = keyId ,
@@ -84,12 +110,12 @@ public static class CryptographyModelFactory
84110 } ;
85111
86112 /// <summary>
87- /// Initializes a new instance of the <see cref="Cryptography.VerifyResult"/> for mocking purposes.
113+ /// Initializes a new instance of the <see cref="Cryptography.VerifyResult"/> class for mocking purposes.
88114 /// </summary>
89115 /// <param name="keyId">Sets the <see cref="VerifyResult.KeyId"/> property.</param>
90116 /// <param name="isValid">Sets the <see cref="VerifyResult.IsValid"/> property.</param>
91117 /// <param name="algorithm">Sets the <see cref="VerifyResult.Algorithm"/> property.</param>
92- /// <returns>A new instance of the <see cref="Cryptography.VerifyResult"/> for mocking purposes.</returns>
118+ /// <returns>A new instance of the <see cref="Cryptography.VerifyResult"/> class for mocking purposes.</returns>
93119 public static VerifyResult VerifyResult ( string keyId = default , bool isValid = default , SignatureAlgorithm algorithm = default ) => new VerifyResult
94120 {
95121 KeyId = keyId ,
@@ -98,12 +124,12 @@ public static class CryptographyModelFactory
98124 } ;
99125
100126 /// <summary>
101- /// Initializes a new instance of the <see cref="Cryptography.WrapResult"/> for mocking purposes.
127+ /// Initializes a new instance of the <see cref="Cryptography.WrapResult"/> class for mocking purposes.
102128 /// </summary>
103129 /// <param name="keyId">Sets the <see cref="WrapResult.KeyId"/> property.</param>
104130 /// <param name="key">Sets the <see cref="WrapResult.EncryptedKey"/> property.</param>
105131 /// <param name="algorithm">Sets the <see cref="WrapResult.Algorithm"/> property.</param>
106- /// <returns>A new instance of the <see cref="Cryptography.WrapResult"/> for mocking purposes.</returns>
132+ /// <returns>A new instance of the <see cref="Cryptography.WrapResult"/> class for mocking purposes.</returns>
107133 public static WrapResult WrapResult ( string keyId = default , byte [ ] key = default , KeyWrapAlgorithm algorithm = default ) => new WrapResult
108134 {
109135 KeyId = keyId ,
0 commit comments