Decrypt messages from a MAM query.

@param mamQuery The MAM query
@return list of decrypted OmemoMessages
@throws SmackException.NotLoggedInException if the Manager is not authenticated.
330324
public List<MessageOrOmemoMessage> decryptMamQueryResult(MamManager.MamQuery mamQuery)
            throws SmackException.NotLoggedInException {
        return new ArrayList<>(getOmemoService().decryptMamQueryResult(new LoggedInOmemoManager(this), mamQuery));
    }
1178501
def decryptMsg(self, ciphertext, textMsg=True):
        

        if not self.sessionStore.containsSession(self.recipientId, self.deviceId):
            raise NoSessionException("No session for: %s, %s" % (self.recipientId, self.deviceId))

        sessionRecord = self.sessionStore.loadSession(self.recipientId, self.deviceId)
        plaintext = self.decryptWithSessionRecord(sessionRecord, ciphertext)

        self.sessionStore.storeSession(self.recipientId, self.deviceId, sessionRecord)

        return plaintext
645525
@Override
    public void recover() throws JMSException {
        checkClosed();
        
        //let's get all unacknowledged message identifiers
        List<SQSMessageIdentifier> unAckedMessages = acknowledger.getUnAckMessages();
        acknowledger.forgetUnAckMessages();
        
        //let's summarize which queues and which message groups we're nacked
        //we have to purge all prefetched messages and queued up callback entries for affected queues and groups
        //if not, we would end up consuming messages out of order
        Map<String, Set<String>> queueToGroupsMapping = getAffectedGroupsPerQueueUrl(unAckedMessages);

        for (SQSMessageConsumer consumer : this.messageConsumers) {
            SQSQueueDestination sqsQueue = (SQSQueueDestination)consumer.getQueue();
            Set<String> affectedGroups = queueToGroupsMapping.get(sqsQueue.getQueueUrl());
            if (affectedGroups != null) {
                unAckedMessages.addAll(consumer.purgePrefetchedMessagesWithGroups(affectedGroups));
            }
        }
        
        unAckedMessages.addAll(sqsSessionRunnable.purgeScheduledCallbacksForQueuesAndGroups(queueToGroupsMapping));
        
        if (!unAckedMessages.isEmpty()) {
            negativeAcknowledger.bulkAction(unAckedMessages, unAckedMessages.size());
        }
    }
395402
private List onQuery(EntityMetadata m, Client client)
    {
        boolean useLuceneOrES = !MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata());
        QueryTranslator translator = new QueryTranslator();
        List<Map<String, Object>> columnsToOutput = translator.getColumnsToOutput(m, getKunderaQuery(), useLuceneOrES);
        translator.translate(getKunderaQuery(), m, useLuceneOrES);
        Filter filters = translator.getFilters();
        if (!translator.isWhereOrAggregationQuery() || !useLuceneOrES)
        {
            return ((HBaseClient) client).findData(m, null, translator.getStartRow(), translator.getEndRow(),
                    columnsToOutput, filters);
        }
        else
        {
            return populateUsingLucene(m, client, null, null);
        }
    }
856453
def get_messages(self):
        
        if not self._messages:  # if not already cached
            query = self._dbman.query('thread:' + self._id)
            thread = next(query.search_threads())

            def accumulate(acc, msg):
                M = Message(self._dbman, msg, thread=self)
                acc[M] = []
                r = msg.get_replies()
                if r is not None:
                    for m in r:
                        acc[M].append(accumulate(acc, m))
                return M

            self._messages = {}
            for m in thread.get_toplevel_messages():
                self._toplevel_messages.append(accumulate(self._messages, m))
        return self._messages
1190170
public final void getMeAsync(SentCallback<User> sentCallback) throws TelegramApiException {
        if (sentCallback == null) {
            throw new TelegramApiException("Parameter sentCallback can not be null");
        }
        sendApiMethodAsync(new GetMe(), sentCallback);
    }
313742
private void getMessageDigestMD5() throws AttributeNotFoundException {
        if (MBeans.messageDigestMD5 == null) {
            try {
                MBeans.messageDigestMD5 = MessageDigestUtility.createMessageDigest("MD5");
            } catch (NoSuchAlgorithmException e) {
                Tr.error(tc, "DYNA1044E", new Object[] { e.getMessage() });
                throw new AttributeNotFoundException("Message digest for MD5 is not available. " + e.getMessage());
            }
        }
    }
3892
public function decryptMsg($msgSignature, $nonce, $timestamp, $postXML)
    {
        try {
            $array = XML::parse($postXML);
        } catch (BaseException $e) {
            throw new EncryptionException('Invalid xml.', EncryptionException::ERROR_PARSE_XML);
        }

        $encrypted = $array['Encrypt'];

        $signature = $this->getSHA1($this->token, $timestamp, $nonce, $encrypted);

        if ($signature !== $msgSignature) {
            throw new EncryptionException('Invalid Signature.', EncryptionException::ERROR_INVALID_SIGNATURE);
        }

        return XML::parse($this->decrypt($encrypted, $this->id));
    }
313472
public boolean[] getKeyUsageMappedBits() {
        KeyUsageExtension keyUsage = new KeyUsageExtension();
        Boolean val = Boolean.TRUE;

        try {
            if (isSet(getPosition(SSL_CLIENT)) ||
                isSet(getPosition(S_MIME)) ||
                isSet(getPosition(OBJECT_SIGNING)))
                keyUsage.set(KeyUsageExtension.DIGITAL_SIGNATURE, val);

            if (isSet(getPosition(SSL_SERVER)))
                keyUsage.set(KeyUsageExtension.KEY_ENCIPHERMENT, val);

            if (isSet(getPosition(SSL_CA)) ||
                isSet(getPosition(S_MIME_CA)) ||
                isSet(getPosition(OBJECT_SIGNING_CA)))
                keyUsage.set(KeyUsageExtension.KEY_CERTSIGN, val);
        } catch (IOException e) { }
        return keyUsage.getBits();
    }
1294915
@Override
    public SIBusMessage[] processMsgSet(SIMessageHandle[] msgHandles,
                                        TransactionCommon transaction,
                                        BifurcatedConsumerSessionImpl owner,
                                        boolean unlock,
                                        boolean delete,
                                        boolean read,
                                        boolean incrementLockCount)

                    throws SISessionUnavailableException, SIMPMessageNotLockedException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "processMsgSet",
                        new Object[] { this,
                                      SIMPUtils.messageHandleArrayToString(msgHandles),
                                      transaction,
                                      owner,
                                      Boolean.valueOf(unlock),
                                      Boolean.valueOf(delete),
                                      Boolean.valueOf(read) });

        // Do a dirty read of the (volatile) closed/closing states to avoid the synch block if poss
        if (_closed || _closing)
        {
            this.lock();
            try
            {
                checkNotClosed();
            } finally
            {
                this.unlock();
            }
        }

        int numMsgs = 0;
        SIBusMessage messages[] = null;

        if (msgHandles != null && msgHandles.length > 0)
            numMsgs = msgHandles.length;

        if (numMsgs > 0)
        {
            // Actually process the message Ids
            messages = _allLockedMessages.processMsgSet(msgHandles, transaction, owner, unlock, delete, read, incrementLockCount);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "processMsgSet", messages);

        return messages;
    }
657931
public byte[] querySmResp(int sequenceNumber, String messageId,
            String finalDate, byte messageState, byte errorCode)
            throws PDUStringException {
        StringValidator.validateString(messageId, StringParameter.MESSAGE_ID);
        StringValidator.validateString(finalDate, StringParameter.FINAL_DATE);

        PDUByteBuffer buf = new PDUByteBuffer(SMPPConstant.CID_QUERY_SM_RESP,
                0, sequenceNumber);
        buf.append(messageId);
        buf.append(finalDate);
        buf.append(messageState);
        buf.append(errorCode);
        return buf.toBytes();
    }
456307
public byte[] decrypt(byte[] cipherBytes) throws MissingParameterException {
		if (cipherBytes == null || cipherBytes.length == 0) {
			throw new MissingParameterException("Missing parameter: cipherBytes");
		}

		return byteEncryptor.decrypt(cipherBytes);

	}
30928
public byte[] decrypt(byte[] msg) {
        if (msg == null) return null;
        try {
            Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM_IMPLEMENTATION);
            SecretKeySpec key = new SecretKeySpec(getMd5(), ENCRYPTION_ALGORITHM);
            IvParameterSpec iv = new IvParameterSpec(getIv());
            cipher.init(Cipher.DECRYPT_MODE, key, iv);
            return cipher.doFinal(msg);
        } catch (Exception e) {
            return null;
        }
    }
1058743
public static List<Audit> findByMessage(EntityManager em, String message) {
        requireArgument(em != null, "Entity manager cannot be null.");
        requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty.");

        TypedQuery<Audit> query = em.createNamedQuery("Audit.findByMessage", Audit.class);

        try {
            query.setParameter("message", "%" + message + "%");
            return query.getResultList();
        } catch (Exception ex) {
            return new ArrayList<Audit>(0);
        }
    }
224209
@Override
    public List<KeyedMessageWithType> invoke(final Mp instance, final KeyedMessage message) throws DempsyException {
        try {
            return Arrays.asList(Optional.ofNullable(instance.handle(message)).orElse(EMPTY_KEYED_MESSAGE_WITH_TYPE));
        } catch(final RuntimeException rte) {
            throw new DempsyException(rte, true);
        }
    }
191174
public void decrypt (byte[] key)
        throws IOException, ClassNotFoundException
    {
        if (_clearCreds != null) {
            return;
        }
        _key = key;
        try {
           _contents = SecureUtil.getAESCipher(Cipher.DECRYPT_MODE, _key).doFinal(_contents);
        } catch (GeneralSecurityException gse) {
            IOException ioe = new IOException("Failed to decrypt credentials");
            ioe.initCause(gse);
            throw ioe;
        }

        ByteArrayInputStream byteIn = new ByteArrayInputStream(_contents);
        ObjectInputStream cipherIn = new ObjectInputStream(byteIn);
        _clearCreds = (Credentials)cipherIn.readObject();
    }
42031
public static void checkQuery(Query<?> query, InjectionManager manager) {
        checkQuery(query, null, null, manager);
    }