• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/iot/v1/resources.proto
18 
19 package com.google.cloud.iot.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * The supported formats for the public key.
26  * </pre>
27  *
28  * Protobuf enum {@code google.cloud.iot.v1.PublicKeyFormat}
29  */
30 public enum PublicKeyFormat implements com.google.protobuf.ProtocolMessageEnum {
31   /**
32    *
33    *
34    * <pre>
35    * The format has not been specified. This is an invalid default value and
36    * must not be used.
37    * </pre>
38    *
39    * <code>UNSPECIFIED_PUBLIC_KEY_FORMAT = 0;</code>
40    */
41   UNSPECIFIED_PUBLIC_KEY_FORMAT(0),
42   /**
43    *
44    *
45    * <pre>
46    * An RSA public key encoded in base64, and wrapped by
47    * `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----`. This can be
48    * used to verify `RS256` signatures in JWT tokens ([RFC7518](
49    * https://www.ietf.org/rfc/rfc7518.txt)).
50    * </pre>
51    *
52    * <code>RSA_PEM = 3;</code>
53    */
54   RSA_PEM(3),
55   /**
56    *
57    *
58    * <pre>
59    * As RSA_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
60    * https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
61    * `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
62    * </pre>
63    *
64    * <code>RSA_X509_PEM = 1;</code>
65    */
66   RSA_X509_PEM(1),
67   /**
68    *
69    *
70    * <pre>
71    * Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in
72    * base64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END
73    * PUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`
74    * algorithm ([RFC7518](https://www.ietf.org/rfc/rfc7518.txt)). This curve is
75    * defined in [OpenSSL](https://www.openssl.org/) as the `prime256v1` curve.
76    * </pre>
77    *
78    * <code>ES256_PEM = 2;</code>
79    */
80   ES256_PEM(2),
81   /**
82    *
83    *
84    * <pre>
85    * As ES256_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
86    * https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
87    * `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
88    * </pre>
89    *
90    * <code>ES256_X509_PEM = 4;</code>
91    */
92   ES256_X509_PEM(4),
93   UNRECOGNIZED(-1),
94   ;
95 
96   /**
97    *
98    *
99    * <pre>
100    * The format has not been specified. This is an invalid default value and
101    * must not be used.
102    * </pre>
103    *
104    * <code>UNSPECIFIED_PUBLIC_KEY_FORMAT = 0;</code>
105    */
106   public static final int UNSPECIFIED_PUBLIC_KEY_FORMAT_VALUE = 0;
107   /**
108    *
109    *
110    * <pre>
111    * An RSA public key encoded in base64, and wrapped by
112    * `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----`. This can be
113    * used to verify `RS256` signatures in JWT tokens ([RFC7518](
114    * https://www.ietf.org/rfc/rfc7518.txt)).
115    * </pre>
116    *
117    * <code>RSA_PEM = 3;</code>
118    */
119   public static final int RSA_PEM_VALUE = 3;
120   /**
121    *
122    *
123    * <pre>
124    * As RSA_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
125    * https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
126    * `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
127    * </pre>
128    *
129    * <code>RSA_X509_PEM = 1;</code>
130    */
131   public static final int RSA_X509_PEM_VALUE = 1;
132   /**
133    *
134    *
135    * <pre>
136    * Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in
137    * base64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END
138    * PUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`
139    * algorithm ([RFC7518](https://www.ietf.org/rfc/rfc7518.txt)). This curve is
140    * defined in [OpenSSL](https://www.openssl.org/) as the `prime256v1` curve.
141    * </pre>
142    *
143    * <code>ES256_PEM = 2;</code>
144    */
145   public static final int ES256_PEM_VALUE = 2;
146   /**
147    *
148    *
149    * <pre>
150    * As ES256_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
151    * https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
152    * `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
153    * </pre>
154    *
155    * <code>ES256_X509_PEM = 4;</code>
156    */
157   public static final int ES256_X509_PEM_VALUE = 4;
158 
getNumber()159   public final int getNumber() {
160     if (this == UNRECOGNIZED) {
161       throw new java.lang.IllegalArgumentException(
162           "Can't get the number of an unknown enum value.");
163     }
164     return value;
165   }
166 
167   /**
168    * @param value The numeric wire value of the corresponding enum entry.
169    * @return The enum associated with the given numeric wire value.
170    * @deprecated Use {@link #forNumber(int)} instead.
171    */
172   @java.lang.Deprecated
valueOf(int value)173   public static PublicKeyFormat valueOf(int value) {
174     return forNumber(value);
175   }
176 
177   /**
178    * @param value The numeric wire value of the corresponding enum entry.
179    * @return The enum associated with the given numeric wire value.
180    */
forNumber(int value)181   public static PublicKeyFormat forNumber(int value) {
182     switch (value) {
183       case 0:
184         return UNSPECIFIED_PUBLIC_KEY_FORMAT;
185       case 3:
186         return RSA_PEM;
187       case 1:
188         return RSA_X509_PEM;
189       case 2:
190         return ES256_PEM;
191       case 4:
192         return ES256_X509_PEM;
193       default:
194         return null;
195     }
196   }
197 
internalGetValueMap()198   public static com.google.protobuf.Internal.EnumLiteMap<PublicKeyFormat> internalGetValueMap() {
199     return internalValueMap;
200   }
201 
202   private static final com.google.protobuf.Internal.EnumLiteMap<PublicKeyFormat> internalValueMap =
203       new com.google.protobuf.Internal.EnumLiteMap<PublicKeyFormat>() {
204         public PublicKeyFormat findValueByNumber(int number) {
205           return PublicKeyFormat.forNumber(number);
206         }
207       };
208 
getValueDescriptor()209   public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
210     if (this == UNRECOGNIZED) {
211       throw new java.lang.IllegalStateException(
212           "Can't get the descriptor of an unrecognized enum value.");
213     }
214     return getDescriptor().getValues().get(ordinal());
215   }
216 
getDescriptorForType()217   public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
218     return getDescriptor();
219   }
220 
getDescriptor()221   public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
222     return com.google.cloud.iot.v1.ResourcesProto.getDescriptor().getEnumTypes().get(6);
223   }
224 
225   private static final PublicKeyFormat[] VALUES = values();
226 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)227   public static PublicKeyFormat valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
228     if (desc.getType() != getDescriptor()) {
229       throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
230     }
231     if (desc.getIndex() == -1) {
232       return UNRECOGNIZED;
233     }
234     return VALUES[desc.getIndex()];
235   }
236 
237   private final int value;
238 
PublicKeyFormat(int value)239   private PublicKeyFormat(int value) {
240     this.value = value;
241   }
242 
243   // @@protoc_insertion_point(enum_scope:google.cloud.iot.v1.PublicKeyFormat)
244 }
245