public static void CreateIssuedToken(Guid transactionId, string coordinationContextId, ProtocolVersion protocolVersion, out RequestSecurityTokenResponse issuedToken, out string sctId)
        {
            sctId = CoordinationContext.CreateNativeIdentifier(Guid.NewGuid());
            byte[]   key    = DeriveIssuedTokenKey(transactionId, sctId);
            DateTime utcNow = DateTime.UtcNow;
            SecurityContextSecurityToken token            = new SecurityContextSecurityToken(new UniqueId(sctId), key, utcNow, utcNow + TimeSpan.FromDays(36500.0));
            BinarySecretSecurityToken    token2           = new BinarySecretSecurityToken(key);
            SecurityStandardsManager     standardsManager = CreateStandardsManager(protocolVersion);
            RequestSecurityTokenResponse response         = new RequestSecurityTokenResponse(standardsManager)
            {
                TokenType = standardsManager.SecureConversationDriver.TokenTypeUri,
                RequestedUnattachedReference = SecurityContextSecurityTokenParameters.CreateKeyIdentifierClause(token, SecurityTokenReferenceStyle.External),
                RequestedAttachedReference   = SecurityContextSecurityTokenParameters.CreateKeyIdentifierClause(token, SecurityTokenReferenceStyle.Internal),
                RequestedSecurityToken       = token,
                RequestedProofToken          = token2
            };
            DataContractSerializer serializer = IdentifierElementSerializer(protocolVersion);

            ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(CoordinationServiceSecurity), "CreateIssuedToken");
            switch (protocolVersion)
            {
            case ProtocolVersion.Version10:
                response.SetAppliesTo <IdentifierElement10>(new IdentifierElement10(coordinationContextId), serializer);
                break;

            case ProtocolVersion.Version11:
                response.SetAppliesTo <IdentifierElement11>(new IdentifierElement11(coordinationContextId), serializer);
                break;
            }
            response.MakeReadOnly();
            if (DebugTrace.Verbose)
            {
                DebugTrace.Trace(TraceLevel.Verbose, "Created issued token with id {0} for transaction {1}", sctId, transactionId);
            }
            issuedToken = response;
        }