<p>
Encryption context to use when the data is reencrypted.
</p>

@param destinationEncryptionContext
Encryption context to use when the data is reencrypted.
185056
public void setDestinationEncryptionContext(java.util.Map<String, String> destinationEncryptionContext) {
        this.destinationEncryptionContext = destinationEncryptionContext == null ? null : new com.amazonaws.internal.SdkInternalMap<String, String>(
                destinationEncryptionContext);
    }
1081363
public void setContexts(java.util.Collection<PhaseContext> contexts) {
        if (contexts == null) {
            this.contexts = null;
            return;
        }

        this.contexts = new java.util.ArrayList<PhaseContext>(contexts);
    }
445457
public boolean destinationExists(String destinationName)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "destinationExists", destinationName);

    boolean returnVal = false;
    
    try
    {
      returnVal = 
        destinationManager.destinationExists(destinationName, 
                                             messageProcessor.getMessagingEngineBus());
    }
    catch (SIMPNullParameterException e)
    {
      // No FFDC code needed
    }
     
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "destinationExists", new Boolean(returnVal));
      
    return returnVal;
  }
831048
def re_encrypt(ciphertext_blob, destination_key_id,
               source_encryption_context=None,
               destination_encryption_context=None, grant_tokens=None,
               region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(
        region=region,
        key=key,
        keyid=keyid,
        profile=profile
    )

    r = {}
    try:
        ciphertext = conn.re_encrypt(
            ciphertext_blob, destination_key_id, source_encryption_context,
            destination_encryption_context, grant_tokens
        )
        r['ciphertext'] = ciphertext
    except boto.exception.BotoServerError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r
1238343
@Override
    protected void store(ConfidentialKey key, byte[] payload) throws IOException {
        try {
            Cipher sym = Secret.getCipher("AES");
            sym.init(Cipher.ENCRYPT_MODE, masterKey);
            try (OutputStream fos = Files.newOutputStream(getFileFor(key).toPath());
                 CipherOutputStream cos = new CipherOutputStream(fos, sym)) {
                cos.write(payload);
                cos.write(MAGIC);
            }
        } catch (GeneralSecurityException e) {
            throw new IOException("Failed to persist the key: "+key.getId(),e);
        } catch (InvalidPathException e) {
            throw new IOException(e);
        }
    }
634064
@Override
  public <CS, CD> MappingContext<CS, CD> create(CS source, Class<CD> destinationType) {
    Assert.notNull(source, "source");
    Assert.notNull(destinationType, "destinationType");

    return new MappingContextImpl<CS, CD>(this, source, Types.<CS>deProxy(source.getClass()), null,
        destinationType, null, null, false);
  }
849862
public DestinationDefinition createDestinationDefinition(
                                                             DestinationType destinationType, String destinationName) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "createDestinationDefinition", new Object[] {
                                                                         destinationType, destinationName });

        JsAdminFactory factory = (JsAdminFactory) getSingletonInstance(SIMPConstants.JS_ADMIN_FACTORY);

        DestinationDefinition destDef = factory.createDestinationDefinition(
                                                                            destinationType, destinationName);

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "createDestinationDefinition", destDef);

        return destDef;
    }
136676
byte[] initSecContext(byte[] inputBuf, int offset, int len) throws GSSException {
        byte[] ret = null;
        if(len == 0){
            byte[] mechToken = context.initSecContext(inputBuf, offset, len);
            int contextFlags = 0;
            if (context.getCredDelegState()) {
                contextFlags |= NegTokenInit.DELEGATION;
            }
            if (context.getMutualAuthState()) {
                contextFlags |= NegTokenInit.MUTUAL_AUTHENTICATION;
            }
            if (context.getReplayDetState()) {
                contextFlags |= NegTokenInit.REPLAY_DETECTION;
            }
            if (context.getSequenceDetState()) {
                contextFlags |= NegTokenInit.SEQUENCE_CHECKING;
            }
            if (context.getAnonymityState()) {
                contextFlags |= NegTokenInit.ANONYMITY;
            }
            if (context.getConfState()) {
                contextFlags |= NegTokenInit.CONFIDENTIALITY;
            }
            if (context.getIntegState()) {
                contextFlags |= NegTokenInit.INTEGRITY;
            }
            ret = new NegTokenInit(new String[]{context.getMech().toString()}, contextFlags, mechToken, null).toByteArray();
        }else{
            SpnegoToken spToken = getToken(inputBuf, offset, len);
            byte[] mechToken = spToken.getMechanismToken();
            mechToken = context.initSecContext(
                    mechToken, 
                        0, mechToken.length);
            if(mechToken!=null){
                int result = NegTokenTarg.ACCEPT_INCOMPLETE;
                if(context.isEstablished()){
                    result = NegTokenTarg.ACCEPT_COMPLETED;
                }
                ret = new NegTokenTarg(result, context.getMech().toString(), mechToken, null).toByteArray();
            }
        }
        return ret;
    }
51531
public static void serializeTo( Destination destination , RawDataBuffer out )
    {
    	try
    	{
    		if (destination == null)
    		{
    			out.writeByte(NO_DESTINATION);
    		}
    		else
	        if (destination instanceof Queue)
	        {
	            out.writeByte(TYPE_QUEUE);
	            out.writeUTF(((Queue)destination).getQueueName());
	        }
	        else
            if (destination instanceof Topic)
            {
            	out.writeByte(TYPE_TOPIC);
                out.writeUTF(((Topic)destination).getTopicName());
            }
            else
                throw new IllegalArgumentException("Unsupported destination : "+destination);
    	}
    	catch (JMSException e)
    	{
    		throw new IllegalArgumentException("Cannot serialize destination : "+e.getMessage());
    	}
    }
908033
private void send(Message message, Destination destination, TestContext context) {
        if (log.isDebugEnabled()) {
            log.debug("Sending JMS message to destination: '" + endpointConfiguration.getDestinationName(destination) + "'");
        }

        endpointConfiguration.getJmsTemplate().send(destination, session -> {
            javax.jms.Message jmsMessage = endpointConfiguration.getMessageConverter().createJmsMessage(message, session, endpointConfiguration, context);
            endpointConfiguration.getMessageConverter().convertOutbound(jmsMessage, message, endpointConfiguration, context);
            return jmsMessage;
        });

        log.info("Message was sent to JMS destination: '" + endpointConfiguration.getDestinationName(destination) + "'");
    }
23824
public void reconstitute(BaseDestinationHandler destinationHandler) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "reconstitute", destinationHandler); 

    super.reconstitute(destinationHandler);
      
    _destHighMsgs = destinationHandler.getMessageProcessor().getHighMessageThreshold();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.exit(tc, "reconstitute");           
    }
  }
112026
public SignalServiceContent decrypt(SignalServiceEnvelope envelope)
      throws InvalidMetadataMessageException, InvalidMetadataVersionException,
      ProtocolInvalidKeyIdException, ProtocolLegacyMessageException,
      ProtocolUntrustedIdentityException, ProtocolNoSessionException,
      ProtocolInvalidVersionException, ProtocolInvalidMessageException,
      ProtocolInvalidKeyException, ProtocolDuplicateMessageException,
      SelfSendException

  {
    try {
      if (envelope.hasLegacyMessage()) {
        Plaintext plaintext = decrypt(envelope, envelope.getLegacyMessage());
        DataMessage message = DataMessage.parseFrom(plaintext.getData());
        return new SignalServiceContent(createSignalServiceMessage(plaintext.getMetadata(), message),
                                        plaintext.getMetadata().getSender(),
                                        plaintext.getMetadata().getSenderDevice(),
                                        plaintext.getMetadata().getTimestamp(),
                                        plaintext.getMetadata().isNeedsReceipt());
      } else if (envelope.hasContent()) {
        Plaintext plaintext = decrypt(envelope, envelope.getContent());
        Content   message   = Content.parseFrom(plaintext.getData());

        if (message.hasDataMessage()) {
          return new SignalServiceContent(createSignalServiceMessage(plaintext.getMetadata(), message.getDataMessage()),
                                          plaintext.getMetadata().getSender(),
                                          plaintext.getMetadata().getSenderDevice(),
                                          plaintext.getMetadata().getTimestamp(),
                                          plaintext.getMetadata().isNeedsReceipt());
        } else if (message.hasSyncMessage() && localAddress.getNumber().equals(plaintext.getMetadata().getSender())) {
          return new SignalServiceContent(createSynchronizeMessage(plaintext.getMetadata(), message.getSyncMessage()),
                                          plaintext.getMetadata().getSender(),
                                          plaintext.getMetadata().getSenderDevice(),
                                          plaintext.getMetadata().getTimestamp(),
                                          plaintext.getMetadata().isNeedsReceipt());
        } else if (message.hasCallMessage()) {
          return new SignalServiceContent(createCallMessage(message.getCallMessage()),
                                          plaintext.getMetadata().getSender(),
                                          plaintext.getMetadata().getSenderDevice(),
                                          plaintext.getMetadata().getTimestamp(),
                                          plaintext.getMetadata().isNeedsReceipt());
        } else if (message.hasReceiptMessage()) {
          return new SignalServiceContent(createReceiptMessage(plaintext.getMetadata(), message.getReceiptMessage()),
                                          plaintext.getMetadata().getSender(),
                                          plaintext.getMetadata().getSenderDevice(),
                                          plaintext.getMetadata().getTimestamp(),
                                          plaintext.getMetadata().isNeedsReceipt());
        } else if (message.hasTypingMessage()) {
          return new SignalServiceContent(createTypingMessage(plaintext.getMetadata(), message.getTypingMessage()),
                                          plaintext.getMetadata().getSender(),
                                          plaintext.getMetadata().getSenderDevice(),
                                          plaintext.getMetadata().getTimestamp(),
                                          false);
        }
      }

      return null;
    } catch (InvalidProtocolBufferException e) {
      throw new InvalidMetadataMessageException(e);
    }
  }
851819
@Override
	public final void setJMSDestination(Destination destination) throws JMSException
    {
    	assertDeserializationLevel(MessageSerializationLevel.FULL);
        this.destination = DestinationTools.asRef(destination);
    }
439444
@Deprecated
    private void checkBrowseAuthority(DestinationHandler destination,
                                      String destinationName,
                                      SecurityContext secContext,
                                      boolean system)

                    throws SINotAuthorizedException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "checkBrowseAuthority",
                        new Object[] { destination,
                                      destinationName,
                                      secContext,
                                      Boolean.valueOf(system) });

        // Check authority to browse a destination
        if (!destination.isTemporary() && !system)
        {
            boolean allowed = true;
            boolean failingOpisIdentityAdopter = false;
            // Perform the alternate user check first. If an alternateUser was set then we 
            // need to determine whether the connected subject has the authority to perform
            // alternate user checks.

            if (secContext.isAlternateUserBased())
            {
                if (!destination.checkDestinationAccess(secContext,
                                                        OperationType.IDENTITY_ADOPTER))
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(tc, "checkBrowseAuthority", "not authorized to perform alternate user checks on this destination");

                    allowed = false;
                    failingOpisIdentityAdopter = true;
                }
            }

            if (allowed) // ok so far
            {
                // Check if its the default exc dest
                if (destinationName.startsWith(SIMPConstants.SYSTEM_DEFAULT_EXCEPTION_DESTINATION_PREFIX))
                {
                    //If its a def exc dest see if we have access to the prefix.
                    if (!_messageProcessor.
                                    getAccessChecker().
                                    checkDestinationAccess(secContext,
                                                           null, // home bus  
                                                           SIMPConstants.SYSTEM_DEFAULT_EXCEPTION_DESTINATION_PREFIX,
                                                           OperationType.RECEIVE))
                    {
                        allowed = false;
                    }
                }
                else
                {
                    if (!destination.checkDestinationAccess(secContext,
                                                            OperationType.BROWSE))
                    {
                        allowed = false;
                    }
                }
            }

            if (!allowed)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "checkBrowseAuthority", "not authorized to browse this destination");

                // Get the username
                String userName = secContext.getUserName(failingOpisIdentityAdopter);
                OperationType operationType =
                                failingOpisIdentityAdopter ? OperationType.IDENTITY_ADOPTER :
                                                OperationType.BROWSE;

                // Build the message for the Exception and the Notification
                String nlsMessage =
                                nls.getFormattedMessage("USER_NOT_AUTH_BROWSE_ERROR_CWSIP0304",
                                                        new Object[] { destination.getName(),
                                                                      userName },
                                                        null);

                // Fire a Notification if Eventing is enabled
                _accessChecker.
                                fireDestinationAccessNotAuthorizedEvent(destination.getName(),
                                                                        userName,
                                                                        operationType,
                                                                        nlsMessage);

                // Thrown if user denied access to destination
                throw new SINotAuthorizedException(nlsMessage);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "checkBrowseAuthority");
    }
1115464
public void setS3Encryption(java.util.Collection<S3Encryption> s3Encryption) {
        if (s3Encryption == null) {
            this.s3Encryption = null;
            return;
        }

        this.s3Encryption = new java.util.ArrayList<S3Encryption>(s3Encryption);
    }
786102
public User setUserContext(User userContext) throws InvalidArgumentException {

        if (null == cryptoSuite) {
            throw new InvalidArgumentException("No cryptoSuite has been set.");
        }
        userContextCheck(userContext);

        User ret = this.userContext;
        this.userContext = userContext;

        logger.debug(
                format("Setting user context to MSPID: %s user: %s", userContext.getMspId(), userContext.getName()));

        return ret;
    }
1368138
public void updateDefinition(BaseDestinationDefinition destinationDefinition)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "updateDefinition", new Object[] {destinationDefinition});
      
    DestinationDefinition oldDefinition = definition;
    DestinationDefinition newDefinition = (DestinationDefinition) destinationDefinition;
      
    // Reset values to force a reload on first reference
    _maxFailedDeliveries = -1;
    _blockedRetryInterval = -1;
    
    if (!isPubSub() && ((oldDefinition == null) ||
        (oldDefinition.isReceiveExclusive() != newDefinition.isReceiveExclusive())))
    {
      // notify the AnycastOutputHandler, *before* throwing off all consumers. 
      // If this is not done, AnycastOutputHandler could
      // create a new consumer before knowing the change in the receiveExclusive value which is not good!
      notifyAOHReceiveExclusiveChange(newDefinition.isReceiveExclusive());

      //throw off all consumers attached through this destination
      ConsumerDispatcher cm = (ConsumerDispatcher)getLocalPtoPConsumerManager();
      if (cm != null)
      {
        cm.closeAllConsumersForReceiveExclusive();
      }
      
      // notify the RME RemoteConsumerDispatchers that the receiveExlusive value has changed
      notifyRCDReceiveExclusiveChange(newDefinition.isReceiveExclusive());
    }
    
    // definition must be updated before notifying consumer dispatcher(s) of update 
    definition = (DestinationDefinition) destinationDefinition;           

    if ((oldDefinition == null) ||
        (oldDefinition.isReceiveAllowed() != newDefinition.isReceiveAllowed()))
    {    
      _isReceiveAllowed = newDefinition.isReceiveAllowed();
      
      notifyReceiveAllowed(this);
      
      //Tell any aliases that inherit the receive allowed value from this
      //destination that the value has changed.
      notifyTargettingAliasesReceiveAllowed();

    }    
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "updateDefinition");
  }