Package io.grpc.alts

Class AltsChannelBuilder


  • @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4151")
    public final class AltsChannelBuilder
    extends io.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>
    ALTS version of ManagedChannelBuilder. This class sets up a secure and authenticated commmunication between two cloud VMs using ALTS.
    • Method Detail

      • forTarget

        public static final AltsChannelBuilder forTarget​(String target)
        "Overrides" the static method in ManagedChannelBuilder.
      • forAddress

        public static AltsChannelBuilder forAddress​(String name,
                                                    int port)
        "Overrides" the static method in ManagedChannelBuilder.
      • addTargetServiceAccount

        public AltsChannelBuilder addTargetServiceAccount​(String targetServiceAccount)
        Adds an expected target service accounts. One of the added service accounts should match peer service account in the handshaker result. Otherwise, the handshake fails.
      • enableUntrustedAltsForTesting

        public AltsChannelBuilder enableUntrustedAltsForTesting()
        Enables untrusted ALTS for testing. If this function is called, we will not check whether ALTS is running on Google Cloud Platform.
      • setHandshakerAddressForTesting

        public AltsChannelBuilder setHandshakerAddressForTesting​(String handshakerAddress)
        Sets a new handshaker service address for testing.
      • delegate

        protected io.grpc.netty.NettyChannelBuilder delegate()
        Specified by:
        delegate in class io.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>
      • build

        public io.grpc.ManagedChannel build()
        Overrides:
        build in class io.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>