:param private_pem:
163355
def signed_token_generator(private_pem, **kwargs):
    
    def signed_token_generator(request):
        request.claims = kwargs
        return common.generate_signed_token(private_pem, request)

    return signed_token_generator
105246
def CreateKey(self, private_key=None):
        
        if private_key is None:
            private_key = bytes(Random.get_random_bytes(32))

        key = KeyPair(priv_key=private_key)
        self._keys[key.PublicKeyHash.ToBytes()] = key
        return key
1197480
def private_rsa
        if password
          options = {:password => password}
          options[:algorithm] = algorithm if algorithm
          
          private_key = @private_key.decrypt(:symmetric, options)
          OpenSSL::PKey::RSA.new(private_key)
        else
          @private_rsa ||= OpenSSL::PKey::RSA.new(@private_key)
        end
      end
412411
def __import_pem(self, key_name, pem_file_path, password):
        
        key_import = self.__get_function_or_ex_function('import_key_pair_from_file')
        pem_file = os.path.expandvars(os.path.expanduser(pem_file_path))
        try:
            pem = paramiko.RSAKey.from_private_key_file(pem_file, password)
        except SSHException:
            try:
                pem = paramiko.DSSKey.from_private_key_file(pem_file, password)
            except SSHException as e:
                raise KeypairError('could not import {f}, neither as RSA key nor as DSA key: {e}'
                                   .format(f=pem_file_path, e=e))
        if not pem:
            raise KeypairError('could not import {f}'.format(f=pem_file_path))
        else:
            with NamedTemporaryFile('w+t') as f:
                f.write('{n} {p}'.format(n=pem.get_name(), p=pem.get_base64()))
                key_import(name=key_name, key_file_path=f.name)
422735
def get_private_name(self, f):
        
        f = self.__swagger_rename__[f] if f in self.__swagger_rename__.keys() else f
        return '_' + self.__class__.__name__ + '__' + f
1278976
def key_file_private(self):
        '''
        '''
        if not hasattr(self, '_key_file_private'):
            self.key_file_private = '~/.ssh/{key}'.format(key=self.key_name)
        return self._key_file_private
902002
def _setPrivate(self, private):
        """"""
        self.private = private
        self.public = pow(self.generator, self.private, self.modulus)
1039835
def serialize_private_key_to_pem(private_key, passphrase_bytes=None):
    
    return private_key.private_bytes(
        encoding=cryptography.hazmat.primitives.serialization.Encoding.PEM,
        format=cryptography.hazmat.primitives.serialization.PrivateFormat.TraditionalOpenSSL,
        encryption_algorithm=cryptography.hazmat.primitives.serialization.BestAvailableEncryption(
            passphrase_bytes
        )
        if passphrase_bytes is not None
        else cryptography.hazmat.primitives.serialization.NoEncryption(),
    )
730413
def generate_private_key(self, key_size=2048, public_exponent=65537):
		
		self.__set_private_key(
			rsa.generate_private_key(
				public_exponent=public_exponent, key_size=key_size, backend=default_backend()
			)
		)
745205
def relative_private_config_file(self):
        

        path = os.path.join(self.working_dir, 'private-config.cfg')
        if os.path.exists(path):
            return 'private-config.cfg'
        else:
            return None
801652
static PemEncoded toPEM(ByteBufAllocator allocator, boolean useDirect, PrivateKey key) {
        // We can take a shortcut if the private key happens to be already
        // PEM/PKCS#8 encoded. This is the ideal case and reason why all
        // this exists. It allows the user to pass pre-encoded bytes straight
        // into OpenSSL without having to do any of the extra work.
        if (key instanceof PemEncoded) {
            return ((PemEncoded) key).retain();
        }

        byte[] bytes = key.getEncoded();
        if (bytes == null) {
            throw new IllegalArgumentException(key.getClass().getName() + " does not support encoding");
        }

        return toPEM(allocator, useDirect, bytes);
    }
798168
def _load_private_key(self, private_key, passphrase=None):
        
        key = None
        last_exception = None
        for pkey_class in (RSAKey, DSSKey):
            try:
                key = pkey_class.from_private_key(StringIO(private_key),
                    passphrase)
            except PasswordRequiredException as e:
                # The key file is encrypted and no passphrase was provided.
                # There's no point to continue trying
                raise
            except SSHException as e:
                last_exception = e
                continue
            else:
                break
        if key is None and last_exception:
            raise last_exception
        return key
774894
def create_private_ip(linode_id):
    
    '''
    kwargs = {'LinodeID': linode_id}
    result = _query('linode', 'ip.addprivate', args=kwargs)

    return _clean_data(result)
1244174
function make_private() {
  return {
    stats: {
      start: Date.now(),
      act: {
        calls: 0,
        done: 0,
        fails: 0,
        cache: 0
      },
      actmap: {}
    },
    actdef: {},
    transport: {
      register: []
    },
    plugins: {},
    ignore_plugins: {}
  }
}
1195835
def DecryptPrivateKey(self, encrypted_private_key):
        
        aes = AES.new(self._master_key, AES.MODE_CBC, self._iv)
        return aes.decrypt(encrypted_private_key)
260040
def get_private_channel(user)
            @users.keys
                .map { |channel| @channels[channel] }
                .compact
                .find { |channel| channel.private }
            # the server doesn't send PMs you don't have access to
        end
925167
def _get_private_key_obj(private_key, passphrase=None):
    '''
    
    '''
    private_key = _text_or_file(private_key)
    private_key = get_pem_entry(private_key, pem_type='(?:RSA )?PRIVATE KEY')
    rsaprivkey = M2Crypto.RSA.load_key_string(
        private_key, callback=_passphrase_callback(passphrase))
    evpprivkey = M2Crypto.EVP.PKey()
    evpprivkey.assign_rsa(rsaprivkey)
    return evpprivkey