GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-docs-samples/compute/signed-metadata/README.md at master · RobinRH/java-docs-samples

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
42 lines (25 loc) · 1.5 KB
/

README.md

Copy path

File metadata and controls

42 lines (25 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Verify instance identity Java sample for Google Compute Engine

Open in Cloud Shell

This repository contains example code in Java that downloads and verifies JWT provided by metadata endpoint, which is available on Compute Engine instances in GCP.

More about this verification can be read on official Google Cloud documentation Veryfying the Identity of Instances.

Running on Compute Engine

To run the sample, you will need to do the following:

  1. Create a compute instance on the Google Cloud Platform Developer's Console

  2. SSH into the instance you created

  3. Update packages and install required packages

    sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven

  4. Clone the repo

    git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git

  5. Navigate to java-docs-samples/compute/signed-metadata/

    cd java-docs-samples/compute/signed-metadata/

  6. Use maven to package the class as a jar

    mvn clean package

  7. Make sure that openjdk 8 is the selected java version

    sudo update-alternatives --config java

  8. Execute the jar file

    java -jar target/compute-signed-metadata-1.0-SNAPSHOT-jar-with-dependencies.jar

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.