Package tahrir.io.net.broadcasts

Examples of tahrir.io.net.broadcasts.UserIdentity


            }
        }

        public static void addTestInformationToNode(final TrNode node) {

            UserIdentity user1 = new UserIdentity("user1", TrCrypto.createRsaKeyPair().a, Optional.of(TrCrypto.createRsaKeyPair().b));
            UserIdentity user2 = new UserIdentity("user2", TrCrypto.createRsaKeyPair().a, Optional.of(TrCrypto.createRsaKeyPair().b));
            UserIdentity user3 = new UserIdentity("User3", node.getRemoteNodeAddress().publicKey, Optional.of(node.getPrivateNodeId().privateKey));
            UserIdentity user4 = new UserIdentity("User4", node.getRemoteNodeAddress().publicKey, Optional.of(node.getPrivateNodeId().privateKey));
            UserIdentity user5 = new UserIdentity("User5", node.getRemoteNodeAddress().publicKey, Optional.of(node.getPrivateNodeId().privateKey));
            UserIdentity user6 = new UserIdentity("User6", node.getRemoteNodeAddress().publicKey, Optional.of(node.getPrivateNodeId().privateKey));
            UserIdentity user7 = new UserIdentity("Guest", TrCrypto.createRsaKeyPair().a, Optional.<RSAPrivateKey>absent());
            node.mbClasses.identityStore.addIdentityWithLabel(TrConstants.FOLLOWING, user1);
            node.mbClasses.identityStore.addIdentity(user2);
            node.mbClasses.identityStore.addIdentityWithLabel(TrConstants.FOLLOWING, user7);
            node.mbClasses.identityStore.addIdentityWithLabel(TrConstants.OWN, user3);
            node.mbClasses.identityStore.addIdentityWithLabel(TrConstants.OWN, user4);
View Full Code Here


        createNewButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(userIdField.getText().length()>0 && (!userIdField.getText().equals("Default") || !userIdField.getText().equals("default"))){
                    node.setCurrentIdentity(userIdField.getText());
                    UserIdentity identity = new UserIdentity(userIdField.getText(), node.getRemoteNodeAddress().publicKey, Optional.of(node.getPrivateNodeId().privateKey));
                    node.mbClasses.identityStore.addIdentityWithLabel(TrConstants.OWN,identity);
                    frame.dispose();

                }
                else{
View Full Code Here

    /**
     * Get a microblog by a random user which has a mention to another random user.
     */
    public static BroadcastMessage getBroadcastMessage(TrNode node1) {
            UserIdentity randomUser = new UserIdentity("Random User", TrCrypto.createRsaKeyPair().a, Optional.of(TrCrypto.createRsaKeyPair().b));
            node1.mbClasses.identityStore.addIdentity(randomUser);
      ParsedBroadcastMessage parsedBroadcastMessage = ParsedBroadcastMessage.createFromPlaintext("Hi @User3, How are you?", "en", node1.mbClasses.identityStore, System.currentTimeMillis());
            SignedBroadcastMessage signedBroadcastMessage = new SignedBroadcastMessage(parsedBroadcastMessage, randomUser);
            BroadcastMessage broadcastMessage = new BroadcastMessage(signedBroadcastMessage);
          return broadcastMessage;
View Full Code Here

TOP

Related Classes of tahrir.io.net.broadcasts.UserIdentity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.