Skip to content

Commit e3ec44e

Browse files
authored
Update and add new KMS samples (GoogleCloudPlatform#2699)
* Update and add new KMS samples * Address review feedback * Rename files * Rotate 30d
1 parent d4e4e2a commit e3ec44e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2510
-1961
lines changed

kms/README.md

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# Cloud Key Management Service
1+
# Google Cloud KMS
22

33
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=kms/README.md">
44
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
55

6-
Google [Cloud Key Management Service](https://cloud.google.com/kms/) is a
7-
cloud-hosted key management service that lets you manage encryption for your
8-
cloud services the same way you do on-premise. You can generate, use, rotate and
9-
destroy AES-256 encryption keys. These sample Java applications demonstrate
10-
how to access the KMS API using the Google Java API Client Libraries.
6+
Google [Cloud KMS](https://cloud.google.com/kms/) is a cloud-hosted key
7+
management service for encrypting, decrypting, signing, and verifying data.
8+
These sample Java applications demonstrate how to access the Cloud KMS API using the
9+
Google Java API Client Libraries.
1110

1211
## Prerequisites
1312

@@ -19,7 +18,9 @@ You must [enable the Google Cloud KMS API](https://console.cloud.google.com/flow
1918

2019
You must set your project ID in order to run the tests
2120

22-
`$export GOOGLE_CLOUD_PROJECT=<your-project-id-here>`
21+
```
22+
$ export GOOGLE_CLOUD_PROJECT="<your-project-id-here>"
23+
```
2324

2425
### Grant Permissions
2526

@@ -32,26 +33,3 @@ You must ensure that the [user account or service account](https://cloud.google.
3233
* Cloud KMS CryptoKey Signer/Verifier
3334

3435
More information can be found in the [Google KMS Docs](https://cloud.google.com/kms/docs/reference/permissions-and-roles)
35-
36-
## Quickstart
37-
38-
Install [Maven](http://maven.apache.org/).
39-
40-
Build your project with:
41-
42-
mvn clean compile assembly:single
43-
44-
You can run the quickstart with:
45-
46-
java -cp target/kms-samples-1.0.11-jar-with-dependencies.jar \
47-
com.example.Quickstart [your-project-id] [your-location]
48-
49-
and can see the available snippet commands with:
50-
51-
java -cp target/kms-samples-1.0.11-jar-with-dependencies.jar \
52-
com.example.Snippets
53-
54-
For example:
55-
56-
java -cp target/kms-samples-1.0.11-jar-with-dependencies.jar \
57-
com.example.Snippets createKeyRing -p [your-project-id] [your-location] myFirstKeyRing

kms/pom.xml

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.google.cloud.kms.samples</groupId>
4+
<groupId>kms</groupId>
55
<artifactId>kms-samples</artifactId>
66
<packaging>jar</packaging>
77

@@ -21,33 +21,13 @@
2121
<maven.compiler.source>1.8</maven.compiler.source>
2222
</properties>
2323

24-
25-
<!--
26-
Using libraries-bom to manage versions.
27-
See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
28-
-->
29-
<dependencyManagement>
30-
<dependencies>
31-
<dependency>
32-
<groupId>com.google.cloud</groupId>
33-
<artifactId>libraries-bom</artifactId>
34-
<version>4.4.1</version>
35-
<type>pom</type>
36-
<scope>import</scope>
37-
</dependency>
38-
</dependencies>
39-
</dependencyManagement>
40-
4124
<dependencies>
4225
<dependency>
4326
<groupId>com.google.cloud</groupId>
4427
<artifactId>google-cloud-kms</artifactId>
28+
<version>1.38.0</version>
4529
</dependency>
46-
<dependency>
47-
<groupId>args4j</groupId>
48-
<artifactId>args4j</artifactId>
49-
<version>2.33</version>
50-
</dependency>
30+
5131
<!-- test dependencies -->
5232
<dependency>
5333
<groupId>junit</groupId>
@@ -62,23 +42,4 @@
6242
<scope>test</scope>
6343
</dependency>
6444
</dependencies>
65-
66-
<build>
67-
<sourceDirectory>src/main/java</sourceDirectory>
68-
<plugins>
69-
<plugin>
70-
<groupId>org.apache.maven.plugins</groupId>
71-
<artifactId>maven-compiler-plugin</artifactId>
72-
</plugin>
73-
<plugin>
74-
<artifactId>maven-assembly-plugin</artifactId>
75-
<configuration>
76-
<descriptorRefs>
77-
<descriptorRef>jar-with-dependencies</descriptorRef>
78-
</descriptorRefs>
79-
</configuration>
80-
</plugin>
81-
</plugins>
82-
</build>
83-
8445
</project>

kms/src/main/java/com/example/Asymmetric.java

Lines changed: 0 additions & 255 deletions
This file was deleted.

0 commit comments

Comments
 (0)