Index: chrome/browser/resources/cryptotoken/googlecorpindividualattest.js |
diff --git a/chrome/browser/resources/cryptotoken/googlecorpindividualattest.js b/chrome/browser/resources/cryptotoken/googlecorpindividualattest.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..57732fc04fe7e395441b2c70ddb3f79feb2aec38 |
--- /dev/null |
+++ b/chrome/browser/resources/cryptotoken/googlecorpindividualattest.js |
@@ -0,0 +1,41 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+/** |
+ * @fileoverview Provides a Google corp implementation of IndividualAttestation. |
+ */ |
+'use strict'; |
+ |
+/** |
+ * Google corp implementation of IndividualAttestation that requests |
+ * individual certificates for corp accounts. |
+ * @constructor |
+ * @implements IndividualAttestation |
+ */ |
+function GoogleCorpIndividualAttestation() {} |
+ |
+/** |
+ * @param {string} appIdHash The app id hash. |
+ * @return {boolean} Whether to request the individual attestation certificate |
+ * for this app id. |
+ */ |
+GoogleCorpIndividualAttestation.prototype.requestIndividualAttestation = |
+ function(appIdHash) { |
+ return appIdHash == GoogleCorpIndividualAttestation.GOOGLE_CORP_APP_ID_HASH; |
+}; |
+ |
+/** |
+ * App ID used by Google employee accounts. |
+ * @const |
+ */ |
+GoogleCorpIndividualAttestation.GOOGLE_CORP_APP_ID = |
+ 'https://www.gstatic.com/securitykey/a/google.com/origins.json'; |
+ |
+/** |
+ * Hash of the app ID used by Google employee accounts. |
+ * @const |
+ */ |
+GoogleCorpIndividualAttestation.GOOGLE_CORP_APP_ID_HASH = |
+ B64_encode(sha256HashOfString( |
+ GoogleCorpIndividualAttestation.GOOGLE_CORP_APP_ID)); |