code: public byte[] decode(final CMSEnvelopedData pkcsPkiEnvelope)
              throws MessageDecodingException {
          LOGGER.debug("Decoding pkcsPkiEnvelope");
          validate(pkcsPkiEnvelope);
  
          LOGGER.debug(
                  "Decrypting pkcsPkiEnvelope using key belonging to [dn={}; serial={}]",
                  recipient.getSubjectDN(), recipient.getSerialNumber());
          final RecipientInformationStore recipientInfos = pkcsPkiEnvelope
                  .getRecipientInfos();
          RecipientInformation info = recipientInfos
                  .get(new JceKeyTransRecipientId(recipient));
  
          if (info == null) {
              throw new MessageDecodingException(
                      "Missing expected key transfer recipient " + recipient.getSubjectDN());
          }
  
          LOGGER.debug("pkcsPkiEnvelope encryption algorithm: {}", info
                  .getKeyEncryptionAlgorithm().getAlgorithm());
  
          try {
              byte[] messageData = info.getContent(getKeyTransRecipient());
              LOGGER.debug("Finished decoding pkcsPkiEnvelope");
              return messageData;
          } catch (CMSException e) {
              throw new MessageDecodingException(e);
          }
      }
docs: Decrypts the provided <tt>pkcsPkiEnvelope</tt>, and extracts the content.
  
  @param pkcsPkiEnvelope
  the envelope to decrypt and open.
  @return the content of the <tt>pkcsPkiEnvelope</tt>, the SCEP
  <tt>messageData</tt>.
  @throws MessageDecodingException
  if the envelope cannot be decoded.