{"action":"created","comment":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/comments/42036919","id":42036919,"diff_hunk":"@@ -0,0 +1,106 @@\n+//-----------------------------------------------------------------------\n+// Copyright (c) Microsoft Open Technologies, Inc.\n+// All Rights Reserved\n+// Apache License 2.0\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+// \n+// http://www.apache.org/licenses/LICENSE-2.0\n+// \n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+//-----------------------------------------------------------------------\n+\n+using System;\n+using System.Diagnostics.Tracing;\n+using System.Globalization;\n+using System.Security.Cryptography;\n+using Microsoft.IdentityModel.Logging;\n+\n+namespace System.IdentityModel.Tokens\n+{\n+    public class ECDsaSecurityKey : AsymmetricSecurityKey\n+    {\n+        private byte[] _blob;\n+        private CngKeyBlobFormat _blobFormat;\n+        private CngKey _cngKey;\n+\n+        public ECDsaSecurityKey(byte[] blob, CngKeyBlobFormat blobFormat)\n+        {\n+            if (blob == null)\n+            {\n+                LogHelper.Throw(string.Format(CultureInfo.InvariantCulture, LogMessages.IDX10000, \"ECDsaSecurityKey.blob\"), typeof(ArgumentNullException), EventLevel.Verbose);\n+            }\n+\n+            if (blobFormat == null)\n+            {\n+                LogHelper.Throw(string.Format(CultureInfo.InvariantCulture, LogMessages.IDX10000, \"ECDsaSecurityKey.blobFormat\"), typeof(ArgumentNullException), EventLevel.Verbose);\n+            }\n+\n+            _cngKey = CngKey.Import(blob, blobFormat);\n+            _blob = blob;\n+            _blobFormat = blobFormat;\n+        }\n+\n+        public override bool HasPrivateKey\n+        {\n+            get\n+            {\n+                return (_blobFormat.Format == CngKeyBlobFormat.EccPrivateBlob.Format || _blobFormat.Format == CngKeyBlobFormat.GenericPrivateBlob.Format);","path":"src/System.IdentityModel.Tokens/ECDSASecurityKey.cs","position":54,"original_position":54,"commit_id":"acaa5302d5b96f2eefbe44ac514fb7a3cc41e268","original_commit_id":"50591e60801c840b564d9afdf494e466c7a6c0b2","user":{"login":"tushargupta51","id":803796,"avatar_url":"https://avatars.githubusercontent.com/u/803796?v=3","gravatar_id":"","url":"https://api.github.com/users/tushargupta51","html_url":"https://github.com/tushargupta51","followers_url":"https://api.github.com/users/tushargupta51/followers","following_url":"https://api.github.com/users/tushargupta51/following{/other_user}","gists_url":"https://api.github.com/users/tushargupta51/gists{/gist_id}","starred_url":"https://api.github.com/users/tushargupta51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tushargupta51/subscriptions","organizations_url":"https://api.github.com/users/tushargupta51/orgs","repos_url":"https://api.github.com/users/tushargupta51/repos","events_url":"https://api.github.com/users/tushargupta51/events{/privacy}","received_events_url":"https://api.github.com/users/tushargupta51/received_events","type":"User","site_admin":false},"body":"We are going to add one more constructor that takes a CngKey so blobs won't be available then.\r\n@AtsushiKan do you have any insights into how we can determine whether a CngKey has privateKey or just publicey?","created_at":"2015-10-14T18:57:14Z","updated_at":"2015-10-14T18:57:14Z","html_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r42036919","pull_request_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281","_links":{"self":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/comments/42036919"},"html":{"href":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r42036919"},"pull_request":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281"}}},"pull_request":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281","id":47459466,"html_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281","diff_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281.diff","patch_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281.patch","issue_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/281","number":281,"state":"open","locked":false,"title":"Adding support for elliptical curve","user":{"login":"tushargupta51","id":803796,"avatar_url":"https://avatars.githubusercontent.com/u/803796?v=3","gravatar_id":"","url":"https://api.github.com/users/tushargupta51","html_url":"https://github.com/tushargupta51","followers_url":"https://api.github.com/users/tushargupta51/followers","following_url":"https://api.github.com/users/tushargupta51/following{/other_user}","gists_url":"https://api.github.com/users/tushargupta51/gists{/gist_id}","starred_url":"https://api.github.com/users/tushargupta51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tushargupta51/subscriptions","organizations_url":"https://api.github.com/users/tushargupta51/orgs","repos_url":"https://api.github.com/users/tushargupta51/repos","events_url":"https://api.github.com/users/tushargupta51/events{/privacy}","received_events_url":"https://api.github.com/users/tushargupta51/received_events","type":"User","site_admin":false},"body":"#83 \r\n#267 \r\n#275 \r\n#85 \r\n#58 \r\n\r\n#57 issue regarding maximum key sizes is not handled in this PR.\n<a href='#crh-start'></a><a href='#crh-data-%7B%22processed%22%3A%20%5B%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41796151%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23issuecomment-147507604%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41798777%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41799627%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41799740%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800264%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800312%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800334%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800518%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800534%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800757%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800899%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41801330%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41802730%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41803480%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41803855%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41804233%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41806585%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23issuecomment-147536009%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41853559%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41853601%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23issuecomment-147688953%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41854421%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41855221%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41894085%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41894125%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41895114%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23issuecomment-147782506%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41900796%22%2C%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41905468%22%5D%2C%20%22comments%22%3A%20%7B%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23issuecomment-147507604%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%40brentschmaltz%20%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A13%3A39Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%2C%20%7B%22body%22%3A%20%22%40brentschmaltz%20updated%22%2C%20%22created_at%22%3A%20%222015-10-12T22%3A16%3A34Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%2C%20%7B%22body%22%3A%20%22Woooo%2C%20there%20are%20some%20exciting%20things%20here%20%3Asmile%3A%20%22%2C%20%22created_at%22%3A%20%222015-10-13T11%3A26%3A46Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/6998306%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/PinpointTownes%22%7D%7D%2C%20%7B%22body%22%3A%20%22Question%3A%20do%20you%20have%20a%20story%20to%20support%20ECDsa%20in%20%60JsonWebKey%60%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T17%3A18%3A55Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/6998306%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/PinpointTownes%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%2054%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41796151%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%40bartonjs%20Does%20this%20look%20right%20to%20you%3F%20ECDsaSecurityKey%20is%20a%20wrapper%20class%20for%20creating%20keys%20to%20be%20used%20for%20ECDsaCng%20algo.%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A13%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%2C%20%7B%22body%22%3A%20%22If%20you%27re%20just%20sticking%20with%20blobs%3B%20those%20are%20the%20two%20that%20exist%20right%20now.%20%20I%20don%27t%20know%20how%20to%20determine%20if%20an%20already%20open%20handle%20has%20a%20private%20key%2C%20though%20%28other%20than%20to%20just%20use%20it%20and%20see%29.%22%2C%20%22created_at%22%3A%20%222015-10-13T17%3A53%3A47Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/10642668%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/bartonjs%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%3AL1-107%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20168%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800312%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22As%20above%20I%20think%20we%20should%20just%20throw%20inside%20here.%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A56%3A04Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL90-199%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20135%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41802730%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22extra%20space%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A22%3A20Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL90-199%22%7D%2C%20%22Pull%20acaa5302d5b96f2eefbe44ac514fb7a3cc41e268%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%2029%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41853559%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Have%20you%20considered%20removing%20these%20fields%20and%20using%20private-set%20properties%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T11%3A15%3A13Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/6998306%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/PinpointTownes%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%3AL1-107%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20170%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41804233%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22We%20don%27t%20need%20to%20create%20the%20hash%20if%20clr%20returns%20RSACryptoServiceProvider%20because%20Sign%20and%20VerifyData%20take%20the%20hash.Name.%20Is%20there%20a%20way%20to%20just%20use%20the%20name%3F%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A38%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%2C%20%7B%22body%22%3A%20%22It%20does%20not%20create%20an%20hashAlgorithm%20object.%20HashAlgorithmName%20is%20only%20a%20struct%2C%20and%20is%20not%20as%20expensive%20as%20SHA1.Create%28%29.%20I%20looked%20through%20the%20.net%20code%20and%20it%20seems%2C%20we%20should%20not%20create%20an%20%5C%22HashAlgorithm%5C%22%20object%20since%20.net%20creates%20an%20HashAlgorithm%20again.%20We%20should%20always%20pass%20the%20string%20representation%20to%20.net.%22%2C%20%22created_at%22%3A%20%222015-10-12T22%3A07%3A17Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL90-199%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20308%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800334%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22As%20above%20I%20think%20we%20should%20just%20throw%20inside%20here.%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A56%3A20Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL251-324%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20310%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41803480%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Do%20we%20need%20to%20make%20this%20call%20to%20GetHashAlgorithm%20for%20ECD%3F%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A29%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%2C%20%7B%22body%22%3A%20%22No%2C%20not%20for%20EC.%20I%20moved%20the%20statement%20to%20if%20blocks%20of%20rsa%20and%20x509.%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A34%3A23Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL251-324%22%7D%2C%20%22Pull%20acaa5302d5b96f2eefbe44ac514fb7a3cc41e268%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%2027%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41854421%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22nit%3A%20the%20file%20name%20differs%20from%20the%20class%20name%20%3Atrollface%3A%20%22%2C%20%22created_at%22%3A%20%222015-10-13T11%3A27%3A38Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/6998306%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/PinpointTownes%22%7D%7D%2C%20%7B%22body%22%3A%20%22thanks%2C%20we%20should%20fix%20this.%22%2C%20%22created_at%22%3A%20%222015-10-13T17%3A00%3A16Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%3AL1-107%22%7D%2C%20%22Pull%20acaa5302d5b96f2eefbe44ac514fb7a3cc41e268%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%2033%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41853601%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22I%20think%20a%20constructor%20directly%20taking%20the%20%60CngKey%60%20might%20be%20useful.%22%2C%20%22created_at%22%3A%20%222015-10-13T11%3A15%3A54Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/6998306%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/PinpointTownes%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%20%22%2C%20%22created_at%22%3A%20%222015-10-13T16%3A59%3A53Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%2C%20%7B%22body%22%3A%20%22Sounds%20good.%20will%20add%20that.%22%2C%20%22created_at%22%3A%20%222015-10-13T17%3A09%3A27Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%3AL1-107%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20109%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41799627%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22I%20think%20it%20would%20be%20cleaner%20to%20throw%20inside%20Resolve...%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A49%3A02Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL90-199%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%2018%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41799740%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22we%20should%20put%20%27_%27%20in%20instance%20variables.%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A50%3A18Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL35-82%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%2082%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800534%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22What%20will%20a%20user%20do%20with%20this%3F%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A58%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%2C%20%7B%22body%22%3A%20%22This%20is%20the%20blob%20format%20used%20to%20generate%20the%20CngKey.%20It%20is%20basically%20a%20string%20wrapper.%20This%20is%20used%20to%20identify%20the%20blob%20format%20used%20to%20create%20the%20cngkey%20-%20%20eccpublic%20or%20eccprivate%20or%20generic.%20Users%20might%20be%20able%20to%20get%20to%20this%20using%20CngKey.GetProperty%20but%20I%20think%20its%20useful%20to%20have%20it%20as%20first%20class%20property.%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A06%3A25Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%3AL1-107%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%2074%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800518%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22What%20will%20a%20user%20do%20with%20this%3F%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A58%3A19Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%2C%20%7B%22body%22%3A%20%22If%20they%20want%20to%20access%20the%20private%20part%20of%20the%20blob.%20Once%20a%20private%20blob%20is%20used%20to%20generate%20a%20CngKey%2C%20they%20can%20only%20export%20the%20public%20blob.%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A02%3A16Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20guess%20it%20depends%20on%20whether%20the%20key%20was%20marked%20as%20exportable%20or%20not%20when%20instantiating%20the%20key%20%28using%20%60ExportPolicy%20%3D%20CngExportPolicies.AllowPlaintextExport%60%29.%5Cr%5Cn%5Cr%5CnI%20think%20it%20might%20be%20a%20good%20idea%20to%20remove%20this%20%60Blob%60%20property%20and%20let%20the%20user%20decide%20whether%20he/she%20wants%20the%20private%20part%20to%20be%20exportable%20via%20%60CngKey.Export%28CngKeyBlobFormat.EccPrivateBlob%29%60.%22%2C%20%22created_at%22%3A%20%222015-10-13T11%3A38%3A47Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/6998306%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/PinpointTownes%22%7D%7D%2C%20%7B%22body%22%3A%20%22Makes%20sense.%20I%20will%20remove%20this%20property.%22%2C%20%22created_at%22%3A%20%222015-10-13T18%3A29%3A55Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/ECDSASecurityKey.cs%3AL1-107%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20164%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41800264%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22We%20are%20not%20consistent%20with%20LogHelper.%20Sometimes%20we%20use%20it%20sometimes%20we%20don%27t.%20Is%20there%20any%20reason%20not%20to%20use%20it%3F%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A55%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%2C%20%7B%22body%22%3A%20%22When%20I%20changed%20throw%20%3D%3E%20LogHelper%2C%20some%20of%20them%20were%20missed.%20All%20of%20them%20should%20be%20LogHelper.%22%2C%20%22created_at%22%3A%20%222015-10-12T21%3A00%3A51Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/803796%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/tushargupta51%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL90-199%22%7D%2C%20%22Pull%2050591e60801c840b564d9afdf494e466c7a6c0b2%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%20102%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281%23discussion_r41798777%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22we%20can%20have%20the%20var%20inside%20the%20%23if%20since%20%23if%20is%20a%20compiler%20switch.%22%2C%20%22created_at%22%3A%20%222015-10-12T20%3A40%3A02Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/3172421%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/brentschmaltz%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs%3AL90-199%22%7D%7D%7D'></a>\n<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/ECDSASecurityKey.cs 54'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41796151'>File: src/System.IdentityModel.Tokens/ECDSASecurityKey.cs:L1-107</a></b>\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> @bartonjs Does this look right to you? ECDsaSecurityKey is a wrapper class for creating keys to be used for ECDsaCng algo.\n- <a href='https://github.com/bartonjs'><img border=0 src='https://avatars.githubusercontent.com/u/10642668?v=3' height=16 width=16'></a> If you're just sticking with blobs; those are the two that exist right now.  I don't know how to determine if an already open handle has a private key, though (other than to just use it and see).\n- [ ] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#issuecomment-147507604'>General Comment</a></b>\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> @brentschmaltz\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> @brentschmaltz updated\n- <a href='https://github.com/PinpointTownes'><img border=0 src='https://avatars.githubusercontent.com/u/6998306?v=3' height=16 width=16'></a> Woooo, there are some exciting things here :smile:\n- <a href='https://github.com/PinpointTownes'><img border=0 src='https://avatars.githubusercontent.com/u/6998306?v=3' height=16 width=16'></a> Question: do you have a story to support ECDsa in `JsonWebKey`?\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 102'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41798777'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L90-199</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> we can have the var inside the #if since #if is a compiler switch.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 109'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41799627'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L90-199</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> I think it would be cleaner to throw inside Resolve...\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 18'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41799740'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L35-82</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> we should put '_' in instance variables.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 164'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41800264'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L90-199</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> We are not consistent with LogHelper. Sometimes we use it sometimes we don't. Is there any reason not to use it?\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> When I changed throw => LogHelper, some of them were missed. All of them should be LogHelper.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 168'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41800312'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L90-199</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> As above I think we should just throw inside here.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 308'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41800334'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L251-324</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> As above I think we should just throw inside here.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/ECDSASecurityKey.cs 74'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41800518'>File: src/System.IdentityModel.Tokens/ECDSASecurityKey.cs:L1-107</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> What will a user do with this?\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> If they want to access the private part of the blob. Once a private blob is used to generate a CngKey, they can only export the public blob.\n- <a href='https://github.com/PinpointTownes'><img border=0 src='https://avatars.githubusercontent.com/u/6998306?v=3' height=16 width=16'></a> I guess it depends on whether the key was marked as exportable or not when instantiating the key (using `ExportPolicy = CngExportPolicies.AllowPlaintextExport`).\nI think it might be a good idea to remove this `Blob` property and let the user decide whether he/she wants the private part to be exportable via `CngKey.Export(CngKeyBlobFormat.EccPrivateBlob)`.\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> Makes sense. I will remove this property.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/ECDSASecurityKey.cs 82'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41800534'>File: src/System.IdentityModel.Tokens/ECDSASecurityKey.cs:L1-107</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> What will a user do with this?\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> This is the blob format used to generate the CngKey. It is basically a string wrapper. This is used to identify the blob format used to create the cngkey -  eccpublic or eccprivate or generic. Users might be able to get to this using CngKey.GetProperty but I think its useful to have it as first class property.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 135'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41802730'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L90-199</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> extra space\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 310'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41803480'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L251-324</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> Do we need to make this call to GetHashAlgorithm for ECD?\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> No, not for EC. I moved the statement to if blocks of rsa and x509.\n- [ ] <a href='#crh-comment-Pull 50591e60801c840b564d9afdf494e466c7a6c0b2 src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs 170'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41804233'>File: src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs:L90-199</a></b>\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> We don't need to create the hash if clr returns RSACryptoServiceProvider because Sign and VerifyData take the hash.Name. Is there a way to just use the name?\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> It does not create an hashAlgorithm object. HashAlgorithmName is only a struct, and is not as expensive as SHA1.Create(). I looked through the .net code and it seems, we should not create an \"HashAlgorithm\" object since .net creates an HashAlgorithm again. We should always pass the string representation to .net.\n- [ ] <a href='#crh-comment-Pull acaa5302d5b96f2eefbe44ac514fb7a3cc41e268 src/System.IdentityModel.Tokens/ECDSASecurityKey.cs 29'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41853559'>File: src/System.IdentityModel.Tokens/ECDSASecurityKey.cs:L1-107</a></b>\n- <a href='https://github.com/PinpointTownes'><img border=0 src='https://avatars.githubusercontent.com/u/6998306?v=3' height=16 width=16'></a> Have you considered removing these fields and using private-set properties?\n- [ ] <a href='#crh-comment-Pull acaa5302d5b96f2eefbe44ac514fb7a3cc41e268 src/System.IdentityModel.Tokens/ECDSASecurityKey.cs 33'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41853601'>File: src/System.IdentityModel.Tokens/ECDSASecurityKey.cs:L1-107</a></b>\n- <a href='https://github.com/PinpointTownes'><img border=0 src='https://avatars.githubusercontent.com/u/6998306?v=3' height=16 width=16'></a> I think a constructor directly taking the `CngKey` might be useful.\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> :+1:\n- <a href='https://github.com/tushargupta51'><img border=0 src='https://avatars.githubusercontent.com/u/803796?v=3' height=16 width=16'></a> Sounds good. will add that.\n- [ ] <a href='#crh-comment-Pull acaa5302d5b96f2eefbe44ac514fb7a3cc41e268 src/System.IdentityModel.Tokens/ECDSASecurityKey.cs 27'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281#discussion_r41854421'>File: src/System.IdentityModel.Tokens/ECDSASecurityKey.cs:L1-107</a></b>\n- <a href='https://github.com/PinpointTownes'><img border=0 src='https://avatars.githubusercontent.com/u/6998306?v=3' height=16 width=16'></a> nit: the file name differs from the class name :trollface:\n- <a href='https://github.com/brentschmaltz'><img border=0 src='https://avatars.githubusercontent.com/u/3172421?v=3' height=16 width=16'></a> thanks, we should fix this.\n\n\n<a href='https://www.codereviewhub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>\n<a href='#crh-end'></a>","created_at":"2015-10-12T20:12:12Z","updated_at":"2015-10-14T18:57:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d3e63ffcfd4865083eff620477174dfd802f5b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281/commits","review_comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281/comments","review_comment_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/281/comments","statuses_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/statuses/acaa5302d5b96f2eefbe44ac514fb7a3cc41e268","head":{"label":"AzureAD:ecSupport","ref":"ecSupport","sha":"acaa5302d5b96f2eefbe44ac514fb7a3cc41e268","user":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"repo":{"id":17496194,"name":"azure-activedirectory-identitymodel-extensions-for-dotnet","full_name":"AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","owner":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","description":"IdentityModel extensions for .Net","fork":false,"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","forks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/forks","keys_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/teams","hooks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/hooks","issue_events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/events","assignees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/tags","blobs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/languages","stargazers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/stargazers","contributors_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/contributors","subscribers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/subscribers","subscription_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/subscription","commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/merges","archive_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/downloads","issues_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases{/id}","created_at":"2014-03-06T23:18:05Z","updated_at":"2015-09-18T14:10:36Z","pushed_at":"2015-10-13T18:39:51Z","git_url":"git://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet.git","ssh_url":"git@github.com:AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet.git","clone_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet.git","svn_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","homepage":"","size":4082,"stargazers_count":85,"watchers_count":85,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":53,"forks":35,"open_issues":53,"watchers":85,"default_branch":"master"}},"base":{"label":"AzureAD:KDev","ref":"KDev","sha":"2b2969149fb73f0cdde07a2064eaa2f8744fd312","user":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"repo":{"id":17496194,"name":"azure-activedirectory-identitymodel-extensions-for-dotnet","full_name":"AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","owner":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","description":"IdentityModel extensions for .Net","fork":false,"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","forks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/forks","keys_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/teams","hooks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/hooks","issue_events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/events","assignees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/tags","blobs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/languages","stargazers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/stargazers","contributors_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/contributors","subscribers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/subscribers","subscription_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/subscription","commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/merges","archive_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/downloads","issues_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases{/id}","created_at":"2014-03-06T23:18:05Z","updated_at":"2015-09-18T14:10:36Z","pushed_at":"2015-10-13T18:39:51Z","git_url":"git://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet.git","ssh_url":"git@github.com:AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet.git","clone_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet.git","svn_url":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet","homepage":"","size":4082,"stargazers_count":85,"watchers_count":85,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":53,"forks":35,"open_issues":53,"watchers":85,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281"},"html":{"href":"https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/281"},"issue":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/281"},"comments":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/statuses/acaa5302d5b96f2eefbe44ac514fb7a3cc41e268"}}}}