[System.Security] Rename method parameters to match .NET contract
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 15 Mar 2017 16:21:21 +0000 (17:21 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 16 Mar 2017 12:02:09 +0000 (13:02 +0100)
mcs/class/System.Security/System.Security.Cryptography.Pkcs/SignedCms.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/CipherReference.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/DataReference.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/EncryptedReference.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/EncryptedXml.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/EncryptionMethod.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/EncryptionProperty.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/KeyInfoEncryptedKey.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/KeyInfoRetrievalMethod.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/KeyReference.cs
mcs/class/System.Security/System.Security.Permissions/DataProtectionPermission.cs

index 52ddd84da3d6889bdc650f48072c2973778acb42..0dbbbdabad5c4ac82ec73c479e4350e058407670 100644 (file)
@@ -55,18 +55,18 @@ namespace System.Security.Cryptography.Pkcs {
                        _info = new SignerInfoCollection ();
                }
 
-               public SignedCms (ContentInfo content) 
-                       : this (content, false)
+               public SignedCms (ContentInfo contentInfo
+                       : this (contentInfo, false)
                {
                }
 
-               public SignedCms (ContentInfo content, bool detached) 
+               public SignedCms (ContentInfo contentInfo, bool detached) 
                        : this ()
                {
-                       if (content == null)
-                               throw new ArgumentNullException ("content");
+                       if (contentInfo == null)
+                               throw new ArgumentNullException ("contentInfo");
 
-                       _content = content;
+                       _content = contentInfo;
                        _detached = detached;
                }
 
@@ -75,14 +75,14 @@ namespace System.Security.Cryptography.Pkcs {
                        _type = signerIdentifierType;
                }
 
-               public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content) 
-                       : this (content, false) 
+               public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo
+                       : this (contentInfo, false) 
                {
                        _type = signerIdentifierType;
                }
 
-               public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content, bool detached) 
-                       : this (content, detached) 
+               public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo, bool detached) 
+                       : this (contentInfo, detached) 
                {
                        _type = signerIdentifierType;
                }
index b927fa2b71bcc88d1ac12e93ab49c8d3b62ed694..9c83f3bb0ab92d69900ac1510cf18bc4661a9588 100644 (file)
@@ -46,8 +46,8 @@ namespace System.Security.Cryptography.Xml {
                {
                }
        
-               public CipherReference (string uri, TransformChain tc)
-                       : base (uri, tc)
+               public CipherReference (string uri, TransformChain transformChain)
+                       : base (uri, transformChain)
                {
                }
        
index 23fedd437a1f7b60676b50c8ca6e5f25f6e9562f..c3aa93666810d79cb9528c1a816d2e4c5c63dbdb 100644 (file)
@@ -48,8 +48,8 @@ namespace System.Security.Cryptography.Xml {
                        ReferenceType = XmlEncryption.ElementNames.DataReference;
                }
        
-               public DataReference (string uri, TransformChain tc)
-                       : base (uri, tc)
+               public DataReference (string uri, TransformChain transformChain)
+                       : base (uri, transformChain)
                {
                        ReferenceType = XmlEncryption.ElementNames.DataReference;
                }
index 04f3799f8cc2760e975c2202ea379fbf1d53c3e7..e748523cbc49855417b2f7e308e61ecc142e1e57 100644 (file)
@@ -55,11 +55,11 @@ namespace System.Security.Cryptography.Xml {
                        TransformChain = new TransformChain ();
                }
        
-               protected EncryptedReference (string uri, TransformChain tc)
+               protected EncryptedReference (string uri, TransformChain transformChain)
                        : this ()
                {
                        Uri = uri;
-                       TransformChain = tc;
+                       TransformChain = transformChain;
                }
        
                #endregion // Constructors
index 6dde9199a2ad36d5c5f9d8620f7444ff22760df2..362f973e35619b9ed08fa418c824910786c85869 100644 (file)
@@ -138,19 +138,19 @@ namespace System.Security.Cryptography.Xml {
                        keyNameMapping.Clear ();
                }
 
-               public byte[] DecryptData (EncryptedData encryptedData, SymmetricAlgorithm symAlg)
+               public byte[] DecryptData (EncryptedData encryptedData, SymmetricAlgorithm symmetricAlgorithm)
                {
                        if (encryptedData == null)
                                throw new ArgumentNullException ("encryptedData");
-                       if (symAlg == null)
-                               throw new ArgumentNullException ("symAlg");
+                       if (symmetricAlgorithm == null)
+                               throw new ArgumentNullException ("symmetricAlgorithm");
 
-                       PaddingMode bak = symAlg.Padding;
+                       PaddingMode bak = symmetricAlgorithm.Padding;
                        try {
-                               symAlg.Padding = Padding;
-                               return Transform (encryptedData.CipherData.CipherValue, symAlg.CreateDecryptor (), symAlg.BlockSize / 8, true);
+                               symmetricAlgorithm.Padding = Padding;
+                               return Transform (encryptedData.CipherData.CipherValue, symmetricAlgorithm.CreateDecryptor (), symmetricAlgorithm.BlockSize / 8, true);
                        } finally {
-                               symAlg.Padding = bak;
+                               symmetricAlgorithm.Padding = bak;
                        }
                }
 
@@ -186,25 +186,25 @@ namespace System.Security.Cryptography.Xml {
                        return DecryptKey (encryptedKey.CipherData.CipherValue, (SymmetricAlgorithm) keyAlg);
                }
 
-               public static byte[] DecryptKey (byte[] keyData, SymmetricAlgorithm symAlg)
+               public static byte[] DecryptKey (byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)
                {
                        if (keyData == null)
                                throw new ArgumentNullException ("keyData");
-                       if (symAlg == null)
-                               throw new ArgumentNullException ("symAlg");
+                       if (symmetricAlgorithm == null)
+                               throw new ArgumentNullException ("symmetricAlgorithm");
 
-                       if (symAlg is TripleDES)
-                               return SymmetricKeyWrap.TripleDESKeyWrapDecrypt (symAlg.Key, keyData);
-                       if (symAlg is Rijndael)
-                               return SymmetricKeyWrap.AESKeyWrapDecrypt (symAlg.Key, keyData);
+                       if (symmetricAlgorithm is TripleDES)
+                               return SymmetricKeyWrap.TripleDESKeyWrapDecrypt (symmetricAlgorithm.Key, keyData);
+                       if (symmetricAlgorithm is Rijndael)
+                               return SymmetricKeyWrap.AESKeyWrapDecrypt (symmetricAlgorithm.Key, keyData);
                        throw new CryptographicException ("The specified cryptographic transform is not supported.");
                }
 
                [MonoTODO ("Test this.")]
-               public static byte[] DecryptKey (byte[] keyData, RSA rsa, bool fOAEP)
+               public static byte[] DecryptKey (byte[] keyData, RSA rsa, bool useOAEP)
                {
                        AsymmetricKeyExchangeDeformatter deformatter = null;
-                       if (fOAEP) 
+                       if (useOAEP) 
                                deformatter = new RSAOAEPKeyExchangeDeformatter (rsa);
                        else
                                deformatter = new RSAPKCS1KeyExchangeDeformatter (rsa);
@@ -254,19 +254,19 @@ namespace System.Security.Cryptography.Xml {
                        throw new NotImplementedException ();
                }
 
-               public byte[] EncryptData (byte[] plainText, SymmetricAlgorithm symAlg)
+               public byte[] EncryptData (byte[] plaintext, SymmetricAlgorithm symmetricAlgorithm)
                {
-                       if (plainText == null)
-                               throw new ArgumentNullException ("plainText");
-                       if (symAlg == null)
-                               throw new ArgumentNullException ("symAlg");
+                       if (plaintext == null)
+                               throw new ArgumentNullException ("plaintext");
+                       if (symmetricAlgorithm == null)
+                               throw new ArgumentNullException ("symmetricAlgorithm");
 
-                       PaddingMode bak = symAlg.Padding;
+                       PaddingMode bak = symmetricAlgorithm.Padding;
                        try {
-                               symAlg.Padding = Padding;
-                               return EncryptDataCore (plainText, symAlg);
+                               symmetricAlgorithm.Padding = Padding;
+                               return EncryptDataCore (plaintext, symmetricAlgorithm);
                        } finally {
-                               symAlg.Padding = bak;
+                               symmetricAlgorithm.Padding = bak;
                        }
                }
 
@@ -289,37 +289,37 @@ namespace System.Security.Cryptography.Xml {
                        return output;
                }
 
-               public byte[] EncryptData (XmlElement inputElement, SymmetricAlgorithm symAlg, bool content)
+               public byte[] EncryptData (XmlElement inputElement, SymmetricAlgorithm symmetricAlgorithm, bool content)
                {
                        if (inputElement == null)
                                throw new ArgumentNullException ("inputElement");
 
                        if (content)
-                               return EncryptData (Encoding.GetBytes (inputElement.InnerXml), symAlg);
+                               return EncryptData (Encoding.GetBytes (inputElement.InnerXml), symmetricAlgorithm);
                        else
-                               return EncryptData (Encoding.GetBytes (inputElement.OuterXml), symAlg);
+                               return EncryptData (Encoding.GetBytes (inputElement.OuterXml), symmetricAlgorithm);
                }
 
-               public static byte[] EncryptKey (byte[] keyData, SymmetricAlgorithm symAlg)
+               public static byte[] EncryptKey (byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)
                {
                        if (keyData == null)
                                throw new ArgumentNullException ("keyData");
-                       if (symAlg == null)
-                               throw new ArgumentNullException ("symAlg");
+                       if (symmetricAlgorithm == null)
+                               throw new ArgumentNullException ("symmetricAlgorithm");
 
-                       if (symAlg is TripleDES)
-                               return SymmetricKeyWrap.TripleDESKeyWrapEncrypt (symAlg.Key, keyData);
-                       if (symAlg is Rijndael)
-                               return SymmetricKeyWrap.AESKeyWrapEncrypt (symAlg.Key, keyData);
+                       if (symmetricAlgorithm is TripleDES)
+                               return SymmetricKeyWrap.TripleDESKeyWrapEncrypt (symmetricAlgorithm.Key, keyData);
+                       if (symmetricAlgorithm is Rijndael)
+                               return SymmetricKeyWrap.AESKeyWrapEncrypt (symmetricAlgorithm.Key, keyData);
 
                        throw new CryptographicException ("The specified cryptographic transform is not supported.");
                }
 
                [MonoTODO ("Test this.")]
-               public static byte[] EncryptKey (byte[] keyData, RSA rsa, bool fOAEP)
+               public static byte[] EncryptKey (byte[] keyData, RSA rsa, bool useOAEP)
                {
                        AsymmetricKeyExchangeFormatter formatter = null;
-                       if (fOAEP) 
+                       if (useOAEP) 
                                formatter = new RSAOAEPKeyExchangeFormatter (rsa);
                        else
                                formatter = new RSAPKCS1KeyExchangeFormatter (rsa);
@@ -402,25 +402,25 @@ namespace System.Security.Cryptography.Xml {
                        throw new ArgumentException ("keyAlg");
                }
 
-               public virtual byte[] GetDecryptionIV (EncryptedData encryptedData, string symAlgUri)
+               public virtual byte[] GetDecryptionIV (EncryptedData encryptedData, string symmetricAlgorithmUri)
                {
                        if (encryptedData == null)
                                throw new ArgumentNullException ("encryptedData");
 
-                       SymmetricAlgorithm symAlg = GetAlgorithm (symAlgUri);
+                       SymmetricAlgorithm symAlg = GetAlgorithm (symmetricAlgorithmUri);
                        byte[] iv = new Byte [symAlg.BlockSize / 8];
                        Buffer.BlockCopy (encryptedData.CipherData.CipherValue, 0, iv, 0, iv.Length);
                        return iv;
                }
 
-               public virtual SymmetricAlgorithm GetDecryptionKey (EncryptedData encryptedData, string symAlgUri)
+               public virtual SymmetricAlgorithm GetDecryptionKey (EncryptedData encryptedData, string symmetricAlgorithmUri)
                {
                        if (encryptedData == null)
                                throw new ArgumentNullException ("encryptedData");
-                       if (symAlgUri == null)
+                       if (symmetricAlgorithmUri == null)
                                return null;
 
-                       SymmetricAlgorithm symAlg = GetAlgorithm (symAlgUri);
+                       SymmetricAlgorithm symAlg = GetAlgorithm (symmetricAlgorithmUri);
                        symAlg.IV = GetDecryptionIV (encryptedData, encryptedData.EncryptionMethod.KeyAlgorithm);
                        KeyInfo keyInfo = encryptedData.KeyInfo;
                        foreach (KeyInfoClause clause in keyInfo) {
index 91815a19a308026260dbebccef5de3ad96883f1f..cd68158bf0f52f54d5eba00247857212dc21231a 100644 (file)
@@ -48,9 +48,9 @@ namespace System.Security.Cryptography.Xml {
                        KeyAlgorithm = null;
                }
 
-               public EncryptionMethod (string strAlgorithm)
+               public EncryptionMethod (string algorithm)
                {
-                       KeyAlgorithm = strAlgorithm;
+                       KeyAlgorithm = algorithm;
                }
 
                #endregion // Constructors
index eee49e6b6a0c95f78e689bf2e0730c098b770cf9..ca662892da9cc9f3435a37a9fadd63765a32e3fb 100644 (file)
@@ -47,9 +47,9 @@ namespace System.Security.Cryptography.Xml {
                {
                }
 
-               public EncryptionProperty (XmlElement elemProp)
+               public EncryptionProperty (XmlElement elementProperty)
                {
-                       LoadXml (elemProp);
+                       LoadXml (elementProperty);
                }
 
                #endregion // Constructors
index afd079b7dc2c62692308e6bdf3282b8111fab019..62aa8afd3ca781bd2966e3a194b520be9c381e7d 100644 (file)
@@ -48,9 +48,9 @@ namespace System.Security.Cryptography.Xml {
                {
                }
 
-               public KeyInfoEncryptedKey (EncryptedKey ek)
+               public KeyInfoEncryptedKey (EncryptedKey encryptedKey)
                {
-                       EncryptedKey = ek;
+                       EncryptedKey = encryptedKey;
                }
 
                #endregion // Constructors
index 2732de63be779629128cea996864910dac1f7c9d..532ba5ca2ce86400967963dae6c573a1def85d80 100644 (file)
@@ -49,10 +49,10 @@ namespace System.Security.Cryptography.Xml {
                        URI = strUri;
                }
 
-               public KeyInfoRetrievalMethod (string strUri, string strType)
+               public KeyInfoRetrievalMethod (string strUri, string typeName)
                        : this (strUri)
                {
-                       Type = strType;
+                       Type = typeName;
                }
 
                [ComVisible (false)]
index 2fe171e72f4b4d7eae831b8ff508f90af715361e..ba33bf25b32e31fd4ac366565a93364fff7afa22 100644 (file)
@@ -48,8 +48,8 @@ namespace System.Security.Cryptography.Xml {
                        ReferenceType = XmlEncryption.ElementNames.KeyReference;
                }
        
-               public KeyReference (string uri, TransformChain tc)
-                       : base (uri, tc)
+               public KeyReference (string uri, TransformChain transformChain)
+                       : base (uri, transformChain)
                {
                        ReferenceType = XmlEncryption.ElementNames.KeyReference;
                }
index e36b30e12b292b2b3aa0e9ee90daf3c576f63432..43560cd40cf6933fdd32f71bf8d21c705ec6c177 100644 (file)
@@ -45,10 +45,10 @@ namespace System.Security.Permissions {
                                _flags = DataProtectionPermissionFlags.AllFlags;
                }
 
-               public DataProtectionPermission (DataProtectionPermissionFlags flags
+               public DataProtectionPermission (DataProtectionPermissionFlags flag) 
                {
                        // reuse validation by the Flags property
-                       Flags = flags;
+                       Flags = flag;
                }
 
 
@@ -114,15 +114,15 @@ namespace System.Security.Permissions {
                        return ((_flags & ~dp._flags) == 0);
                }
 
-               public override void FromXml (SecurityElement e
+               public override void FromXml (SecurityElement securityElement
                {
                        // General validation in CodeAccessPermission
-                       PermissionHelper.CheckSecurityElement (e, "e", version, version);
+                       PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
                        // Note: we do not (yet) care about the return value 
                        // as we only accept version 1 (min/max values)
 
                        _flags = (DataProtectionPermissionFlags) Enum.Parse (
-                               typeof (DataProtectionPermissionFlags), e.Attribute ("Flags"));
+                               typeof (DataProtectionPermissionFlags), securityElement.Attribute ("Flags"));
                }
 
                public override SecurityElement ToXml ()