android-lib/src/main/java/io/v/android/inspectors/RemoteInspectors.java
/**
     * Invite a remote user to inspect state of the application.
     *
     * @param invitee the name to refer to the remote user as (typically an email address)
     * @param duration time after which inspection privileges expire
     *
     * @return A textual description of how the remote user can access state of the running
     * application.
     */
Invite a remote user to inspect state of the application.
@param invitee the name to refer to the remote user as (typically an email address)
@param duration time after which inspection privileges expire

@return A textual description of how the remote user can access state of the running
application.
Invite a remote user to inspect state of the application . @param invitee the name to refer to the remote user as ( typically an email address ) @param duration time after which inspection privileges expire @return A textual description of how the remote user can access state of the running application .
public synchronized String invite(String invitee, ReadableDuration duration)
        throws  VException {
        if (mCtx == null) {
            throw new VException("RemoteInspectors.stop already called");
        }
        Caveat debugOnly = VSecurity.newCaveat(
                io.v.v23.security.access.Constants.ACCESS_TAG_CAVEAT, mTags);
        Caveat expiration = VSecurity.newExpiryCaveat(DateTime.now().plus(duration));
        String privateKey;
        VPrincipal delegate;
        try {
            KeyPairGenerator e = KeyPairGenerator.getInstance("EC");
            e.initialize(256);
            KeyPair keyPair = e.generateKeyPair();
            privateKey = Base64.encodeToString(keyPair.getPrivate().getEncoded(), BASE64_FLAGS);
            delegate = VSecurity.newPrincipal(
                    VSecurity.newSigner(keyPair.getPrivate(), (ECPublicKey) keyPair.getPublic()));
        } catch (NoSuchAlgorithmException e) {
            throw new VException("Could not mint private key: " + e.getMessage());
        }
        VPrincipal me = V.getPrincipal(mCtx);
        Blessings b = me.bless(
                delegate.publicKey(),
                me.blessingStore().defaultBlessings(),
                "debugger" + io.v.v23.security.Constants.CHAIN_SEPARATOR + invitee,
                debugOnly,
                expiration);
        StringBuilder builder = new StringBuilder()
                .append("Please inspect my application using:")
                .append('\n')
                .append('\n')
                .append("debug browse")
                .append(" --key=").append(privateKey)
                .append(" --blessings=").append(Base64.encodeToString(
                        VomUtil.encode(b, b.getClass()), BASE64_FLAGS))
                .append(" ");
        return appendServerAddresses(builder).toString();
    }
public synchronized String invite ( String invitee , ReadableDuration duration ) throws VException { if ( mCtx == null ) { throw new VException ( "RemoteInspectors.stop already called" ) ; } Caveat debugOnly = VSecurity . newCaveat ( io . v . v23 . security . access . Constants . ACCESS_TAG_CAVEAT , mTags ) ; Caveat expiration = VSecurity . newExpiryCaveat ( DateTime . now ( ) . plus ( duration ) ) ; String privateKey ; VPrincipal delegate ; try { KeyPairGenerator e = KeyPairGenerator . getInstance ( "EC" ) ; e . initialize ( 256 ) ; KeyPair keyPair = e . generateKeyPair ( ) ; privateKey = Base64 . encodeToString ( keyPair . getPrivate ( ) . getEncoded ( ) , BASE64_FLAGS ) ; delegate = VSecurity . newPrincipal ( VSecurity . newSigner ( keyPair . getPrivate ( ) , ( ECPublicKey ) keyPair . getPublic ( ) ) ) ; } catch ( NoSuchAlgorithmException e ) { throw new VException ( "Could not mint private key: " + e . getMessage ( ) ) ; } VPrincipal me = V . getPrincipal ( mCtx ) ; Blessings b = me . bless ( delegate . publicKey ( ) , me . blessingStore ( ) . defaultBlessings ( ) , "debugger" + io . v . v23 . security . Constants . CHAIN_SEPARATOR + invitee , debugOnly , expiration ) ; StringBuilder builder = new StringBuilder ( ) . append ( "Please inspect my application using:" ) . append ( '\n' ) . append ( '\n' ) . append ( "debug browse" ) . append ( " --key=" ) . append ( privateKey ) . append ( " --blessings=" ) . append ( Base64 . encodeToString ( VomUtil . encode ( b , b . getClass ( ) ) , BASE64_FLAGS ) ) . append ( " " ) ; return appendServerAddresses ( builder ) . toString ( ) ; }
Invite a remote user to inspect state of the application.
Invite a remote user to inspect state of the application .