<commit_before>/**
 * @license
 * Copyright 2015 Google Inc. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @fileoverview Default implementation of Context2.
 */
goog.provide('e2e.openpgp.Context2Impl');

goog.require('e2e');
/** @suppress {extraRequire} force loading of all ciphers */
goog.require('e2e.cipher.all');
/** @suppress {extraRequire} force loading of all compression methods */
goog.require('e2e.compression.all');
/** @suppress {extraRequire} force loading of all hash functions */
goog.require('e2e.hash.all');
goog.require('e2e.openpgp.ClearSignMessage');
goog.require('e2e.openpgp.Context2');
goog.require('e2e.openpgp.KeyProviderCipher');
goog.require('e2e.openpgp.KeyPurposeType');
goog.require('e2e.openpgp.KeyRingType');
goog.require('e2e.openpgp.asciiArmor');
goog.require('e2e.openpgp.block.EncryptedMessage');
goog.require('e2e.openpgp.block.LiteralMessage');
goog.require('e2e.openpgp.block.TransferablePublicKey');
goog.require('e2e.openpgp.block.factory');
goog.require('e2e.openpgp.error.InvalidArgumentsError');
goog.require('e2e.openpgp.error.ParseError');
goog.require('e2e.openpgp.error.UnsupportedError');
goog.require('e2e.openpgp.packet.SurrogateSecretKey');
/** @suppress {extraRequire} force loading of all signers */
goog.require('e2e.signer.all');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.async.Deferred');



/**
 * Implements a "context". Provides a high level API for key management,
 * encryption and signing. This context is used by external code, such as the
 * extension's user interface, to call the base OpenPGP library.
 * @constructor
 * @param {!e2e.openpgp.managers.KeyManager} keyManager The Key Manager object.
 * @implements {e2e.openpgp.Context2}
 */
e2e.openpgp.Context2Impl = function(keyManager) {
  /**
   * Key Manager object.
   * @private {!e2e.openpgp.managers.KeyManager}
   */
  this.keyManager_ = keyManager;
  /**
   * Should the output of the functions be ASCII-armored.
   * @private {boolean}
   */
  this.armorOutput_ = true;
  /**
   * List of headers to add to armored messages (Version, Comment, etc).
   * @type {!Object.<string>}
   * @private
   */
  this.armorHeaders_ = {};
};


/**
 * Deferred constructor.
 * @param {!goog.Thenable.<!e2e.openpgp.managers.KeyManager>} keyManagerPromise
 *     The promise of the Key Manager instance.
 * @return {!goog.Thenable.<!e2e.openpgp.Context2Impl>} The Context2Impl
 *     promise, fulfilled when the object will initialize.
 */
e2e.openpgp.Context2Impl.launch = function(keyManagerPromise) {
  return keyManagerPromise.then(function(keyManager) {
    return new e2e.openpgp.Context2Impl(keyManager);
  });<commit_msg>Changed the type annotation for a private property. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=104640645<commit_after>/**
 * @license
 * Copyright 2015 Google Inc. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @fileoverview Default implementation of Context2.
 */
goog.provide('e2e.openpgp.Context2Impl');

goog.require('e2e');
/** @suppress {extraRequire} force loading of all ciphers */
goog.require('e2e.cipher.all');
/** @suppress {extraRequire} force loading of all compression methods */
goog.require('e2e.compression.all');
/** @suppress {extraRequire} force loading of all hash functions */
goog.require('e2e.hash.all');
goog.require('e2e.openpgp.ClearSignMessage');
goog.require('e2e.openpgp.Context2');
goog.require('e2e.openpgp.KeyProviderCipher');
goog.require('e2e.openpgp.KeyPurposeType');
goog.require('e2e.openpgp.KeyRingType');
goog.require('e2e.openpgp.asciiArmor');
goog.require('e2e.openpgp.block.EncryptedMessage');
goog.require('e2e.openpgp.block.LiteralMessage');
goog.require('e2e.openpgp.block.TransferablePublicKey');
goog.require('e2e.openpgp.block.factory');
goog.require('e2e.openpgp.error.InvalidArgumentsError');
goog.require('e2e.openpgp.error.ParseError');
goog.require('e2e.openpgp.error.UnsupportedError');
goog.require('e2e.openpgp.packet.SurrogateSecretKey');
/** @suppress {extraRequire} force loading of all signers */
goog.require('e2e.signer.all');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.async.Deferred');



/**
 * Implements a "context". Provides a high level API for key management,
 * encryption and signing. This context is used by external code, such as the
 * extension's user interface, to call the base OpenPGP library.
 * @constructor
 * @param {!e2e.openpgp.managers.KeyManager} keyManager The Key Manager object.
 * @implements {e2e.openpgp.Context2}
 */
e2e.openpgp.Context2Impl = function(keyManager) {
  /**
   * Key Manager object.
   * @private {!e2e.openpgp.managers.KeyManager}
   */
  this.keyManager_ = keyManager;
  /**
   * Should the output of the functions be ASCII-armored.
   * @private {boolean}
   */
  this.armorOutput_ = true;
  /**
   * List of headers to add to armored messages (Version, Comment, etc).
   * @private {!Object.<string>}
   */
  this.armorHeaders_ = {};
};


/**
 * Deferred constructor.
 * @param {!goog.Thenable.<!e2e.openpgp.managers.KeyManager>} keyManagerPromise
 *     The promise of the Key Manager instance.
 * @return {!goog.Thenable.<!e2e.openpgp.Context2Impl>} The Context2Impl
 *     promise, fulfilled when the object will initialize.
 */
e2e.openpgp.Context2Impl.launch = function(keyManagerPromise) {
  return keyManagerPromise.then(function(keyManager) {
    return new e2e.openpgp.Context2Impl(keyManager);
  });
{'fraction_non_alphanumeric': 0.13645990922844176, 'fraction_numerical': 0.01497730711043873, 'mean_word_length': 4.699137931034483, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6713608', 'n_tokens_mistral': 2189, 'n_tokens_neox': 2087, 'n_words': 521}