Beispiel #1
0
        /// <summary>
        /// Creates an information access token to allow a grantee to see the standing orders
        /// of one of the grantor's accounts.
        /// </summary>
        /// <param name="grantor">Token member granting access to her account</param>
        /// <param name="accountId">ID of account to grant access to</param>
        /// <param name="granteeAlias">Token member alias acquiring information access</param>
        /// <returns>An access Token</returns>
        public static Token CreateStandingOrdersAccessToken(
            UserMember grantor,
            string accountId,
            Alias granteeAlias)
        {
            // Create an access token for the grantee to access bank
            // account names of the grantor.
            Token accessToken = grantor.CreateAccessTokenBlocking(
                Tokenio.User.AccessTokenBuilder
                .Create(granteeAlias)
                .ForAccount(accountId)
                .ForAccountStandingOrders(accountId));

            // Grantor endorses a token to a grantee by signing it
            // with her secure private key.
            accessToken = grantor.EndorseTokenBlocking(
                accessToken,
                Level.Standard).Token;
            return(accessToken);
        }