• 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/binaryauthorization/v1beta1/resources.proto
18 
19 package com.google.cloud.binaryauthorization.v1beta1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * An [attestor public key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be used to verify
26  * attestations signed by this attestor.
27  * </pre>
28  *
29  * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AttestorPublicKey}
30  */
31 public final class AttestorPublicKey extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey)
34     AttestorPublicKeyOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use AttestorPublicKey.newBuilder() to construct.
AttestorPublicKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private AttestorPublicKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
AttestorPublicKey()41   private AttestorPublicKey() {
42     comment_ = "";
43     id_ = "";
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new AttestorPublicKey();
50   }
51 
52   @java.lang.Override
getUnknownFields()53   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54     return this.unknownFields;
55   }
56 
getDescriptor()57   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
58     return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto
59         .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor;
60   }
61 
62   @java.lang.Override
63   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()64       internalGetFieldAccessorTable() {
65     return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto
66         .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.class,
69             com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder.class);
70   }
71 
72   private int publicKeyCase_ = 0;
73   private java.lang.Object publicKey_;
74 
75   public enum PublicKeyCase
76       implements
77           com.google.protobuf.Internal.EnumLite,
78           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
79     ASCII_ARMORED_PGP_PUBLIC_KEY(3),
80     PKIX_PUBLIC_KEY(5),
81     PUBLICKEY_NOT_SET(0);
82     private final int value;
83 
PublicKeyCase(int value)84     private PublicKeyCase(int value) {
85       this.value = value;
86     }
87     /**
88      * @param value The number of the enum to look for.
89      * @return The enum associated with the given number.
90      * @deprecated Use {@link #forNumber(int)} instead.
91      */
92     @java.lang.Deprecated
valueOf(int value)93     public static PublicKeyCase valueOf(int value) {
94       return forNumber(value);
95     }
96 
forNumber(int value)97     public static PublicKeyCase forNumber(int value) {
98       switch (value) {
99         case 3:
100           return ASCII_ARMORED_PGP_PUBLIC_KEY;
101         case 5:
102           return PKIX_PUBLIC_KEY;
103         case 0:
104           return PUBLICKEY_NOT_SET;
105         default:
106           return null;
107       }
108     }
109 
getNumber()110     public int getNumber() {
111       return this.value;
112     }
113   };
114 
getPublicKeyCase()115   public PublicKeyCase getPublicKeyCase() {
116     return PublicKeyCase.forNumber(publicKeyCase_);
117   }
118 
119   public static final int COMMENT_FIELD_NUMBER = 1;
120 
121   @SuppressWarnings("serial")
122   private volatile java.lang.Object comment_ = "";
123   /**
124    *
125    *
126    * <pre>
127    * Optional. A descriptive comment. This field may be updated.
128    * </pre>
129    *
130    * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
131    *
132    * @return The comment.
133    */
134   @java.lang.Override
getComment()135   public java.lang.String getComment() {
136     java.lang.Object ref = comment_;
137     if (ref instanceof java.lang.String) {
138       return (java.lang.String) ref;
139     } else {
140       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
141       java.lang.String s = bs.toStringUtf8();
142       comment_ = s;
143       return s;
144     }
145   }
146   /**
147    *
148    *
149    * <pre>
150    * Optional. A descriptive comment. This field may be updated.
151    * </pre>
152    *
153    * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
154    *
155    * @return The bytes for comment.
156    */
157   @java.lang.Override
getCommentBytes()158   public com.google.protobuf.ByteString getCommentBytes() {
159     java.lang.Object ref = comment_;
160     if (ref instanceof java.lang.String) {
161       com.google.protobuf.ByteString b =
162           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
163       comment_ = b;
164       return b;
165     } else {
166       return (com.google.protobuf.ByteString) ref;
167     }
168   }
169 
170   public static final int ID_FIELD_NUMBER = 2;
171 
172   @SuppressWarnings("serial")
173   private volatile java.lang.Object id_ = "";
174   /**
175    *
176    *
177    * <pre>
178    * The ID of this public key.
179    * Signatures verified by BinAuthz must include the ID of the public key that
180    * can be used to verify them, and that ID must match the contents of this
181    * field exactly.
182    * Additional restrictions on this field can be imposed based on which public
183    * key type is encapsulated. See the documentation on `public_key` cases below
184    * for details.
185    * </pre>
186    *
187    * <code>string id = 2;</code>
188    *
189    * @return The id.
190    */
191   @java.lang.Override
getId()192   public java.lang.String getId() {
193     java.lang.Object ref = id_;
194     if (ref instanceof java.lang.String) {
195       return (java.lang.String) ref;
196     } else {
197       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
198       java.lang.String s = bs.toStringUtf8();
199       id_ = s;
200       return s;
201     }
202   }
203   /**
204    *
205    *
206    * <pre>
207    * The ID of this public key.
208    * Signatures verified by BinAuthz must include the ID of the public key that
209    * can be used to verify them, and that ID must match the contents of this
210    * field exactly.
211    * Additional restrictions on this field can be imposed based on which public
212    * key type is encapsulated. See the documentation on `public_key` cases below
213    * for details.
214    * </pre>
215    *
216    * <code>string id = 2;</code>
217    *
218    * @return The bytes for id.
219    */
220   @java.lang.Override
getIdBytes()221   public com.google.protobuf.ByteString getIdBytes() {
222     java.lang.Object ref = id_;
223     if (ref instanceof java.lang.String) {
224       com.google.protobuf.ByteString b =
225           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
226       id_ = b;
227       return b;
228     } else {
229       return (com.google.protobuf.ByteString) ref;
230     }
231   }
232 
233   public static final int ASCII_ARMORED_PGP_PUBLIC_KEY_FIELD_NUMBER = 3;
234   /**
235    *
236    *
237    * <pre>
238    * ASCII-armored representation of a PGP public key, as the entire output by
239    * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
240    * line endings).
241    * When using this field, `id` should be left blank.  The BinAuthz API
242    * handlers will calculate the ID and fill it in automatically.  BinAuthz
243    * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
244    * upper-case hex.  If `id` is provided by the caller, it will be
245    * overwritten by the API-calculated ID.
246    * </pre>
247    *
248    * <code>string ascii_armored_pgp_public_key = 3;</code>
249    *
250    * @return Whether the asciiArmoredPgpPublicKey field is set.
251    */
hasAsciiArmoredPgpPublicKey()252   public boolean hasAsciiArmoredPgpPublicKey() {
253     return publicKeyCase_ == 3;
254   }
255   /**
256    *
257    *
258    * <pre>
259    * ASCII-armored representation of a PGP public key, as the entire output by
260    * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
261    * line endings).
262    * When using this field, `id` should be left blank.  The BinAuthz API
263    * handlers will calculate the ID and fill it in automatically.  BinAuthz
264    * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
265    * upper-case hex.  If `id` is provided by the caller, it will be
266    * overwritten by the API-calculated ID.
267    * </pre>
268    *
269    * <code>string ascii_armored_pgp_public_key = 3;</code>
270    *
271    * @return The asciiArmoredPgpPublicKey.
272    */
getAsciiArmoredPgpPublicKey()273   public java.lang.String getAsciiArmoredPgpPublicKey() {
274     java.lang.Object ref = "";
275     if (publicKeyCase_ == 3) {
276       ref = publicKey_;
277     }
278     if (ref instanceof java.lang.String) {
279       return (java.lang.String) ref;
280     } else {
281       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
282       java.lang.String s = bs.toStringUtf8();
283       if (publicKeyCase_ == 3) {
284         publicKey_ = s;
285       }
286       return s;
287     }
288   }
289   /**
290    *
291    *
292    * <pre>
293    * ASCII-armored representation of a PGP public key, as the entire output by
294    * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
295    * line endings).
296    * When using this field, `id` should be left blank.  The BinAuthz API
297    * handlers will calculate the ID and fill it in automatically.  BinAuthz
298    * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
299    * upper-case hex.  If `id` is provided by the caller, it will be
300    * overwritten by the API-calculated ID.
301    * </pre>
302    *
303    * <code>string ascii_armored_pgp_public_key = 3;</code>
304    *
305    * @return The bytes for asciiArmoredPgpPublicKey.
306    */
getAsciiArmoredPgpPublicKeyBytes()307   public com.google.protobuf.ByteString getAsciiArmoredPgpPublicKeyBytes() {
308     java.lang.Object ref = "";
309     if (publicKeyCase_ == 3) {
310       ref = publicKey_;
311     }
312     if (ref instanceof java.lang.String) {
313       com.google.protobuf.ByteString b =
314           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
315       if (publicKeyCase_ == 3) {
316         publicKey_ = b;
317       }
318       return b;
319     } else {
320       return (com.google.protobuf.ByteString) ref;
321     }
322   }
323 
324   public static final int PKIX_PUBLIC_KEY_FIELD_NUMBER = 5;
325   /**
326    *
327    *
328    * <pre>
329    * A raw PKIX SubjectPublicKeyInfo format public key.
330    * NOTE: `id` may be explicitly provided by the caller when using this
331    * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
332    * blank, a default one will be computed based on the digest of the DER
333    * encoding of the public key.
334    * </pre>
335    *
336    * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
337    *
338    * @return Whether the pkixPublicKey field is set.
339    */
340   @java.lang.Override
hasPkixPublicKey()341   public boolean hasPkixPublicKey() {
342     return publicKeyCase_ == 5;
343   }
344   /**
345    *
346    *
347    * <pre>
348    * A raw PKIX SubjectPublicKeyInfo format public key.
349    * NOTE: `id` may be explicitly provided by the caller when using this
350    * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
351    * blank, a default one will be computed based on the digest of the DER
352    * encoding of the public key.
353    * </pre>
354    *
355    * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
356    *
357    * @return The pkixPublicKey.
358    */
359   @java.lang.Override
getPkixPublicKey()360   public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getPkixPublicKey() {
361     if (publicKeyCase_ == 5) {
362       return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_;
363     }
364     return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance();
365   }
366   /**
367    *
368    *
369    * <pre>
370    * A raw PKIX SubjectPublicKeyInfo format public key.
371    * NOTE: `id` may be explicitly provided by the caller when using this
372    * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
373    * blank, a default one will be computed based on the digest of the DER
374    * encoding of the public key.
375    * </pre>
376    *
377    * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
378    */
379   @java.lang.Override
380   public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder
getPkixPublicKeyOrBuilder()381       getPkixPublicKeyOrBuilder() {
382     if (publicKeyCase_ == 5) {
383       return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_;
384     }
385     return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance();
386   }
387 
388   private byte memoizedIsInitialized = -1;
389 
390   @java.lang.Override
isInitialized()391   public final boolean isInitialized() {
392     byte isInitialized = memoizedIsInitialized;
393     if (isInitialized == 1) return true;
394     if (isInitialized == 0) return false;
395 
396     memoizedIsInitialized = 1;
397     return true;
398   }
399 
400   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)401   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
402     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(comment_)) {
403       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, comment_);
404     }
405     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
406       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_);
407     }
408     if (publicKeyCase_ == 3) {
409       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, publicKey_);
410     }
411     if (publicKeyCase_ == 5) {
412       output.writeMessage(
413           5, (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_);
414     }
415     getUnknownFields().writeTo(output);
416   }
417 
418   @java.lang.Override
getSerializedSize()419   public int getSerializedSize() {
420     int size = memoizedSize;
421     if (size != -1) return size;
422 
423     size = 0;
424     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(comment_)) {
425       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, comment_);
426     }
427     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
428       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_);
429     }
430     if (publicKeyCase_ == 3) {
431       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, publicKey_);
432     }
433     if (publicKeyCase_ == 5) {
434       size +=
435           com.google.protobuf.CodedOutputStream.computeMessageSize(
436               5, (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_);
437     }
438     size += getUnknownFields().getSerializedSize();
439     memoizedSize = size;
440     return size;
441   }
442 
443   @java.lang.Override
equals(final java.lang.Object obj)444   public boolean equals(final java.lang.Object obj) {
445     if (obj == this) {
446       return true;
447     }
448     if (!(obj instanceof com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey)) {
449       return super.equals(obj);
450     }
451     com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey other =
452         (com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) obj;
453 
454     if (!getComment().equals(other.getComment())) return false;
455     if (!getId().equals(other.getId())) return false;
456     if (!getPublicKeyCase().equals(other.getPublicKeyCase())) return false;
457     switch (publicKeyCase_) {
458       case 3:
459         if (!getAsciiArmoredPgpPublicKey().equals(other.getAsciiArmoredPgpPublicKey()))
460           return false;
461         break;
462       case 5:
463         if (!getPkixPublicKey().equals(other.getPkixPublicKey())) return false;
464         break;
465       case 0:
466       default:
467     }
468     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
469     return true;
470   }
471 
472   @java.lang.Override
hashCode()473   public int hashCode() {
474     if (memoizedHashCode != 0) {
475       return memoizedHashCode;
476     }
477     int hash = 41;
478     hash = (19 * hash) + getDescriptor().hashCode();
479     hash = (37 * hash) + COMMENT_FIELD_NUMBER;
480     hash = (53 * hash) + getComment().hashCode();
481     hash = (37 * hash) + ID_FIELD_NUMBER;
482     hash = (53 * hash) + getId().hashCode();
483     switch (publicKeyCase_) {
484       case 3:
485         hash = (37 * hash) + ASCII_ARMORED_PGP_PUBLIC_KEY_FIELD_NUMBER;
486         hash = (53 * hash) + getAsciiArmoredPgpPublicKey().hashCode();
487         break;
488       case 5:
489         hash = (37 * hash) + PKIX_PUBLIC_KEY_FIELD_NUMBER;
490         hash = (53 * hash) + getPkixPublicKey().hashCode();
491         break;
492       case 0:
493       default:
494     }
495     hash = (29 * hash) + getUnknownFields().hashCode();
496     memoizedHashCode = hash;
497     return hash;
498   }
499 
parseFrom( java.nio.ByteBuffer data)500   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
501       java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
502     return PARSER.parseFrom(data);
503   }
504 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)505   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
506       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
507       throws com.google.protobuf.InvalidProtocolBufferException {
508     return PARSER.parseFrom(data, extensionRegistry);
509   }
510 
parseFrom( com.google.protobuf.ByteString data)511   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
512       com.google.protobuf.ByteString data)
513       throws com.google.protobuf.InvalidProtocolBufferException {
514     return PARSER.parseFrom(data);
515   }
516 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)517   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
518       com.google.protobuf.ByteString data,
519       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
520       throws com.google.protobuf.InvalidProtocolBufferException {
521     return PARSER.parseFrom(data, extensionRegistry);
522   }
523 
parseFrom( byte[] data)524   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
525       byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
526     return PARSER.parseFrom(data);
527   }
528 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)529   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
530       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
531       throws com.google.protobuf.InvalidProtocolBufferException {
532     return PARSER.parseFrom(data, extensionRegistry);
533   }
534 
parseFrom( java.io.InputStream input)535   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
536       java.io.InputStream input) throws java.io.IOException {
537     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
538   }
539 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)540   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
541       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
542       throws java.io.IOException {
543     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
544         PARSER, input, extensionRegistry);
545   }
546 
parseDelimitedFrom( java.io.InputStream input)547   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseDelimitedFrom(
548       java.io.InputStream input) throws java.io.IOException {
549     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
550   }
551 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)552   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseDelimitedFrom(
553       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
554       throws java.io.IOException {
555     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
556         PARSER, input, extensionRegistry);
557   }
558 
parseFrom( com.google.protobuf.CodedInputStream input)559   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
560       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
561     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
562   }
563 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)564   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom(
565       com.google.protobuf.CodedInputStream input,
566       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
567       throws java.io.IOException {
568     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
569         PARSER, input, extensionRegistry);
570   }
571 
572   @java.lang.Override
newBuilderForType()573   public Builder newBuilderForType() {
574     return newBuilder();
575   }
576 
newBuilder()577   public static Builder newBuilder() {
578     return DEFAULT_INSTANCE.toBuilder();
579   }
580 
newBuilder( com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey prototype)581   public static Builder newBuilder(
582       com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey prototype) {
583     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
584   }
585 
586   @java.lang.Override
toBuilder()587   public Builder toBuilder() {
588     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
589   }
590 
591   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)592   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
593     Builder builder = new Builder(parent);
594     return builder;
595   }
596   /**
597    *
598    *
599    * <pre>
600    * An [attestor public key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be used to verify
601    * attestations signed by this attestor.
602    * </pre>
603    *
604    * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AttestorPublicKey}
605    */
606   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
607       implements
608       // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey)
609       com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder {
getDescriptor()610     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
611       return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto
612           .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor;
613     }
614 
615     @java.lang.Override
616     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()617         internalGetFieldAccessorTable() {
618       return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto
619           .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_fieldAccessorTable
620           .ensureFieldAccessorsInitialized(
621               com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.class,
622               com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder.class);
623     }
624 
625     // Construct using com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.newBuilder()
Builder()626     private Builder() {}
627 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)628     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
629       super(parent);
630     }
631 
632     @java.lang.Override
clear()633     public Builder clear() {
634       super.clear();
635       bitField0_ = 0;
636       comment_ = "";
637       id_ = "";
638       if (pkixPublicKeyBuilder_ != null) {
639         pkixPublicKeyBuilder_.clear();
640       }
641       publicKeyCase_ = 0;
642       publicKey_ = null;
643       return this;
644     }
645 
646     @java.lang.Override
getDescriptorForType()647     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
648       return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto
649           .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor;
650     }
651 
652     @java.lang.Override
653     public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey
getDefaultInstanceForType()654         getDefaultInstanceForType() {
655       return com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.getDefaultInstance();
656     }
657 
658     @java.lang.Override
build()659     public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey build() {
660       com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result = buildPartial();
661       if (!result.isInitialized()) {
662         throw newUninitializedMessageException(result);
663       }
664       return result;
665     }
666 
667     @java.lang.Override
buildPartial()668     public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey buildPartial() {
669       com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result =
670           new com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey(this);
671       if (bitField0_ != 0) {
672         buildPartial0(result);
673       }
674       buildPartialOneofs(result);
675       onBuilt();
676       return result;
677     }
678 
buildPartial0( com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result)679     private void buildPartial0(
680         com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result) {
681       int from_bitField0_ = bitField0_;
682       if (((from_bitField0_ & 0x00000001) != 0)) {
683         result.comment_ = comment_;
684       }
685       if (((from_bitField0_ & 0x00000002) != 0)) {
686         result.id_ = id_;
687       }
688     }
689 
buildPartialOneofs( com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result)690     private void buildPartialOneofs(
691         com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result) {
692       result.publicKeyCase_ = publicKeyCase_;
693       result.publicKey_ = this.publicKey_;
694       if (publicKeyCase_ == 5 && pkixPublicKeyBuilder_ != null) {
695         result.publicKey_ = pkixPublicKeyBuilder_.build();
696       }
697     }
698 
699     @java.lang.Override
clone()700     public Builder clone() {
701       return super.clone();
702     }
703 
704     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)705     public Builder setField(
706         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
707       return super.setField(field, value);
708     }
709 
710     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)711     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
712       return super.clearField(field);
713     }
714 
715     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)716     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
717       return super.clearOneof(oneof);
718     }
719 
720     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)721     public Builder setRepeatedField(
722         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
723       return super.setRepeatedField(field, index, value);
724     }
725 
726     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)727     public Builder addRepeatedField(
728         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
729       return super.addRepeatedField(field, value);
730     }
731 
732     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)733     public Builder mergeFrom(com.google.protobuf.Message other) {
734       if (other instanceof com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) {
735         return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) other);
736       } else {
737         super.mergeFrom(other);
738         return this;
739       }
740     }
741 
mergeFrom(com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey other)742     public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey other) {
743       if (other
744           == com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.getDefaultInstance())
745         return this;
746       if (!other.getComment().isEmpty()) {
747         comment_ = other.comment_;
748         bitField0_ |= 0x00000001;
749         onChanged();
750       }
751       if (!other.getId().isEmpty()) {
752         id_ = other.id_;
753         bitField0_ |= 0x00000002;
754         onChanged();
755       }
756       switch (other.getPublicKeyCase()) {
757         case ASCII_ARMORED_PGP_PUBLIC_KEY:
758           {
759             publicKeyCase_ = 3;
760             publicKey_ = other.publicKey_;
761             onChanged();
762             break;
763           }
764         case PKIX_PUBLIC_KEY:
765           {
766             mergePkixPublicKey(other.getPkixPublicKey());
767             break;
768           }
769         case PUBLICKEY_NOT_SET:
770           {
771             break;
772           }
773       }
774       this.mergeUnknownFields(other.getUnknownFields());
775       onChanged();
776       return this;
777     }
778 
779     @java.lang.Override
isInitialized()780     public final boolean isInitialized() {
781       return true;
782     }
783 
784     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)785     public Builder mergeFrom(
786         com.google.protobuf.CodedInputStream input,
787         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
788         throws java.io.IOException {
789       if (extensionRegistry == null) {
790         throw new java.lang.NullPointerException();
791       }
792       try {
793         boolean done = false;
794         while (!done) {
795           int tag = input.readTag();
796           switch (tag) {
797             case 0:
798               done = true;
799               break;
800             case 10:
801               {
802                 comment_ = input.readStringRequireUtf8();
803                 bitField0_ |= 0x00000001;
804                 break;
805               } // case 10
806             case 18:
807               {
808                 id_ = input.readStringRequireUtf8();
809                 bitField0_ |= 0x00000002;
810                 break;
811               } // case 18
812             case 26:
813               {
814                 java.lang.String s = input.readStringRequireUtf8();
815                 publicKeyCase_ = 3;
816                 publicKey_ = s;
817                 break;
818               } // case 26
819             case 42:
820               {
821                 input.readMessage(getPkixPublicKeyFieldBuilder().getBuilder(), extensionRegistry);
822                 publicKeyCase_ = 5;
823                 break;
824               } // case 42
825             default:
826               {
827                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
828                   done = true; // was an endgroup tag
829                 }
830                 break;
831               } // default:
832           } // switch (tag)
833         } // while (!done)
834       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
835         throw e.unwrapIOException();
836       } finally {
837         onChanged();
838       } // finally
839       return this;
840     }
841 
842     private int publicKeyCase_ = 0;
843     private java.lang.Object publicKey_;
844 
getPublicKeyCase()845     public PublicKeyCase getPublicKeyCase() {
846       return PublicKeyCase.forNumber(publicKeyCase_);
847     }
848 
clearPublicKey()849     public Builder clearPublicKey() {
850       publicKeyCase_ = 0;
851       publicKey_ = null;
852       onChanged();
853       return this;
854     }
855 
856     private int bitField0_;
857 
858     private java.lang.Object comment_ = "";
859     /**
860      *
861      *
862      * <pre>
863      * Optional. A descriptive comment. This field may be updated.
864      * </pre>
865      *
866      * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
867      *
868      * @return The comment.
869      */
getComment()870     public java.lang.String getComment() {
871       java.lang.Object ref = comment_;
872       if (!(ref instanceof java.lang.String)) {
873         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
874         java.lang.String s = bs.toStringUtf8();
875         comment_ = s;
876         return s;
877       } else {
878         return (java.lang.String) ref;
879       }
880     }
881     /**
882      *
883      *
884      * <pre>
885      * Optional. A descriptive comment. This field may be updated.
886      * </pre>
887      *
888      * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
889      *
890      * @return The bytes for comment.
891      */
getCommentBytes()892     public com.google.protobuf.ByteString getCommentBytes() {
893       java.lang.Object ref = comment_;
894       if (ref instanceof String) {
895         com.google.protobuf.ByteString b =
896             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
897         comment_ = b;
898         return b;
899       } else {
900         return (com.google.protobuf.ByteString) ref;
901       }
902     }
903     /**
904      *
905      *
906      * <pre>
907      * Optional. A descriptive comment. This field may be updated.
908      * </pre>
909      *
910      * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
911      *
912      * @param value The comment to set.
913      * @return This builder for chaining.
914      */
setComment(java.lang.String value)915     public Builder setComment(java.lang.String value) {
916       if (value == null) {
917         throw new NullPointerException();
918       }
919       comment_ = value;
920       bitField0_ |= 0x00000001;
921       onChanged();
922       return this;
923     }
924     /**
925      *
926      *
927      * <pre>
928      * Optional. A descriptive comment. This field may be updated.
929      * </pre>
930      *
931      * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
932      *
933      * @return This builder for chaining.
934      */
clearComment()935     public Builder clearComment() {
936       comment_ = getDefaultInstance().getComment();
937       bitField0_ = (bitField0_ & ~0x00000001);
938       onChanged();
939       return this;
940     }
941     /**
942      *
943      *
944      * <pre>
945      * Optional. A descriptive comment. This field may be updated.
946      * </pre>
947      *
948      * <code>string comment = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
949      *
950      * @param value The bytes for comment to set.
951      * @return This builder for chaining.
952      */
setCommentBytes(com.google.protobuf.ByteString value)953     public Builder setCommentBytes(com.google.protobuf.ByteString value) {
954       if (value == null) {
955         throw new NullPointerException();
956       }
957       checkByteStringIsUtf8(value);
958       comment_ = value;
959       bitField0_ |= 0x00000001;
960       onChanged();
961       return this;
962     }
963 
964     private java.lang.Object id_ = "";
965     /**
966      *
967      *
968      * <pre>
969      * The ID of this public key.
970      * Signatures verified by BinAuthz must include the ID of the public key that
971      * can be used to verify them, and that ID must match the contents of this
972      * field exactly.
973      * Additional restrictions on this field can be imposed based on which public
974      * key type is encapsulated. See the documentation on `public_key` cases below
975      * for details.
976      * </pre>
977      *
978      * <code>string id = 2;</code>
979      *
980      * @return The id.
981      */
getId()982     public java.lang.String getId() {
983       java.lang.Object ref = id_;
984       if (!(ref instanceof java.lang.String)) {
985         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
986         java.lang.String s = bs.toStringUtf8();
987         id_ = s;
988         return s;
989       } else {
990         return (java.lang.String) ref;
991       }
992     }
993     /**
994      *
995      *
996      * <pre>
997      * The ID of this public key.
998      * Signatures verified by BinAuthz must include the ID of the public key that
999      * can be used to verify them, and that ID must match the contents of this
1000      * field exactly.
1001      * Additional restrictions on this field can be imposed based on which public
1002      * key type is encapsulated. See the documentation on `public_key` cases below
1003      * for details.
1004      * </pre>
1005      *
1006      * <code>string id = 2;</code>
1007      *
1008      * @return The bytes for id.
1009      */
getIdBytes()1010     public com.google.protobuf.ByteString getIdBytes() {
1011       java.lang.Object ref = id_;
1012       if (ref instanceof String) {
1013         com.google.protobuf.ByteString b =
1014             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1015         id_ = b;
1016         return b;
1017       } else {
1018         return (com.google.protobuf.ByteString) ref;
1019       }
1020     }
1021     /**
1022      *
1023      *
1024      * <pre>
1025      * The ID of this public key.
1026      * Signatures verified by BinAuthz must include the ID of the public key that
1027      * can be used to verify them, and that ID must match the contents of this
1028      * field exactly.
1029      * Additional restrictions on this field can be imposed based on which public
1030      * key type is encapsulated. See the documentation on `public_key` cases below
1031      * for details.
1032      * </pre>
1033      *
1034      * <code>string id = 2;</code>
1035      *
1036      * @param value The id to set.
1037      * @return This builder for chaining.
1038      */
setId(java.lang.String value)1039     public Builder setId(java.lang.String value) {
1040       if (value == null) {
1041         throw new NullPointerException();
1042       }
1043       id_ = value;
1044       bitField0_ |= 0x00000002;
1045       onChanged();
1046       return this;
1047     }
1048     /**
1049      *
1050      *
1051      * <pre>
1052      * The ID of this public key.
1053      * Signatures verified by BinAuthz must include the ID of the public key that
1054      * can be used to verify them, and that ID must match the contents of this
1055      * field exactly.
1056      * Additional restrictions on this field can be imposed based on which public
1057      * key type is encapsulated. See the documentation on `public_key` cases below
1058      * for details.
1059      * </pre>
1060      *
1061      * <code>string id = 2;</code>
1062      *
1063      * @return This builder for chaining.
1064      */
clearId()1065     public Builder clearId() {
1066       id_ = getDefaultInstance().getId();
1067       bitField0_ = (bitField0_ & ~0x00000002);
1068       onChanged();
1069       return this;
1070     }
1071     /**
1072      *
1073      *
1074      * <pre>
1075      * The ID of this public key.
1076      * Signatures verified by BinAuthz must include the ID of the public key that
1077      * can be used to verify them, and that ID must match the contents of this
1078      * field exactly.
1079      * Additional restrictions on this field can be imposed based on which public
1080      * key type is encapsulated. See the documentation on `public_key` cases below
1081      * for details.
1082      * </pre>
1083      *
1084      * <code>string id = 2;</code>
1085      *
1086      * @param value The bytes for id to set.
1087      * @return This builder for chaining.
1088      */
setIdBytes(com.google.protobuf.ByteString value)1089     public Builder setIdBytes(com.google.protobuf.ByteString value) {
1090       if (value == null) {
1091         throw new NullPointerException();
1092       }
1093       checkByteStringIsUtf8(value);
1094       id_ = value;
1095       bitField0_ |= 0x00000002;
1096       onChanged();
1097       return this;
1098     }
1099 
1100     /**
1101      *
1102      *
1103      * <pre>
1104      * ASCII-armored representation of a PGP public key, as the entire output by
1105      * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
1106      * line endings).
1107      * When using this field, `id` should be left blank.  The BinAuthz API
1108      * handlers will calculate the ID and fill it in automatically.  BinAuthz
1109      * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
1110      * upper-case hex.  If `id` is provided by the caller, it will be
1111      * overwritten by the API-calculated ID.
1112      * </pre>
1113      *
1114      * <code>string ascii_armored_pgp_public_key = 3;</code>
1115      *
1116      * @return Whether the asciiArmoredPgpPublicKey field is set.
1117      */
1118     @java.lang.Override
hasAsciiArmoredPgpPublicKey()1119     public boolean hasAsciiArmoredPgpPublicKey() {
1120       return publicKeyCase_ == 3;
1121     }
1122     /**
1123      *
1124      *
1125      * <pre>
1126      * ASCII-armored representation of a PGP public key, as the entire output by
1127      * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
1128      * line endings).
1129      * When using this field, `id` should be left blank.  The BinAuthz API
1130      * handlers will calculate the ID and fill it in automatically.  BinAuthz
1131      * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
1132      * upper-case hex.  If `id` is provided by the caller, it will be
1133      * overwritten by the API-calculated ID.
1134      * </pre>
1135      *
1136      * <code>string ascii_armored_pgp_public_key = 3;</code>
1137      *
1138      * @return The asciiArmoredPgpPublicKey.
1139      */
1140     @java.lang.Override
getAsciiArmoredPgpPublicKey()1141     public java.lang.String getAsciiArmoredPgpPublicKey() {
1142       java.lang.Object ref = "";
1143       if (publicKeyCase_ == 3) {
1144         ref = publicKey_;
1145       }
1146       if (!(ref instanceof java.lang.String)) {
1147         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1148         java.lang.String s = bs.toStringUtf8();
1149         if (publicKeyCase_ == 3) {
1150           publicKey_ = s;
1151         }
1152         return s;
1153       } else {
1154         return (java.lang.String) ref;
1155       }
1156     }
1157     /**
1158      *
1159      *
1160      * <pre>
1161      * ASCII-armored representation of a PGP public key, as the entire output by
1162      * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
1163      * line endings).
1164      * When using this field, `id` should be left blank.  The BinAuthz API
1165      * handlers will calculate the ID and fill it in automatically.  BinAuthz
1166      * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
1167      * upper-case hex.  If `id` is provided by the caller, it will be
1168      * overwritten by the API-calculated ID.
1169      * </pre>
1170      *
1171      * <code>string ascii_armored_pgp_public_key = 3;</code>
1172      *
1173      * @return The bytes for asciiArmoredPgpPublicKey.
1174      */
1175     @java.lang.Override
getAsciiArmoredPgpPublicKeyBytes()1176     public com.google.protobuf.ByteString getAsciiArmoredPgpPublicKeyBytes() {
1177       java.lang.Object ref = "";
1178       if (publicKeyCase_ == 3) {
1179         ref = publicKey_;
1180       }
1181       if (ref instanceof String) {
1182         com.google.protobuf.ByteString b =
1183             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1184         if (publicKeyCase_ == 3) {
1185           publicKey_ = b;
1186         }
1187         return b;
1188       } else {
1189         return (com.google.protobuf.ByteString) ref;
1190       }
1191     }
1192     /**
1193      *
1194      *
1195      * <pre>
1196      * ASCII-armored representation of a PGP public key, as the entire output by
1197      * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
1198      * line endings).
1199      * When using this field, `id` should be left blank.  The BinAuthz API
1200      * handlers will calculate the ID and fill it in automatically.  BinAuthz
1201      * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
1202      * upper-case hex.  If `id` is provided by the caller, it will be
1203      * overwritten by the API-calculated ID.
1204      * </pre>
1205      *
1206      * <code>string ascii_armored_pgp_public_key = 3;</code>
1207      *
1208      * @param value The asciiArmoredPgpPublicKey to set.
1209      * @return This builder for chaining.
1210      */
setAsciiArmoredPgpPublicKey(java.lang.String value)1211     public Builder setAsciiArmoredPgpPublicKey(java.lang.String value) {
1212       if (value == null) {
1213         throw new NullPointerException();
1214       }
1215       publicKeyCase_ = 3;
1216       publicKey_ = value;
1217       onChanged();
1218       return this;
1219     }
1220     /**
1221      *
1222      *
1223      * <pre>
1224      * ASCII-armored representation of a PGP public key, as the entire output by
1225      * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
1226      * line endings).
1227      * When using this field, `id` should be left blank.  The BinAuthz API
1228      * handlers will calculate the ID and fill it in automatically.  BinAuthz
1229      * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
1230      * upper-case hex.  If `id` is provided by the caller, it will be
1231      * overwritten by the API-calculated ID.
1232      * </pre>
1233      *
1234      * <code>string ascii_armored_pgp_public_key = 3;</code>
1235      *
1236      * @return This builder for chaining.
1237      */
clearAsciiArmoredPgpPublicKey()1238     public Builder clearAsciiArmoredPgpPublicKey() {
1239       if (publicKeyCase_ == 3) {
1240         publicKeyCase_ = 0;
1241         publicKey_ = null;
1242         onChanged();
1243       }
1244       return this;
1245     }
1246     /**
1247      *
1248      *
1249      * <pre>
1250      * ASCII-armored representation of a PGP public key, as the entire output by
1251      * the command `gpg --export --armor foo&#64;example.com` (either LF or CRLF
1252      * line endings).
1253      * When using this field, `id` should be left blank.  The BinAuthz API
1254      * handlers will calculate the ID and fill it in automatically.  BinAuthz
1255      * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
1256      * upper-case hex.  If `id` is provided by the caller, it will be
1257      * overwritten by the API-calculated ID.
1258      * </pre>
1259      *
1260      * <code>string ascii_armored_pgp_public_key = 3;</code>
1261      *
1262      * @param value The bytes for asciiArmoredPgpPublicKey to set.
1263      * @return This builder for chaining.
1264      */
setAsciiArmoredPgpPublicKeyBytes(com.google.protobuf.ByteString value)1265     public Builder setAsciiArmoredPgpPublicKeyBytes(com.google.protobuf.ByteString value) {
1266       if (value == null) {
1267         throw new NullPointerException();
1268       }
1269       checkByteStringIsUtf8(value);
1270       publicKeyCase_ = 3;
1271       publicKey_ = value;
1272       onChanged();
1273       return this;
1274     }
1275 
1276     private com.google.protobuf.SingleFieldBuilderV3<
1277             com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey,
1278             com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder,
1279             com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder>
1280         pkixPublicKeyBuilder_;
1281     /**
1282      *
1283      *
1284      * <pre>
1285      * A raw PKIX SubjectPublicKeyInfo format public key.
1286      * NOTE: `id` may be explicitly provided by the caller when using this
1287      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1288      * blank, a default one will be computed based on the digest of the DER
1289      * encoding of the public key.
1290      * </pre>
1291      *
1292      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1293      *
1294      * @return Whether the pkixPublicKey field is set.
1295      */
1296     @java.lang.Override
hasPkixPublicKey()1297     public boolean hasPkixPublicKey() {
1298       return publicKeyCase_ == 5;
1299     }
1300     /**
1301      *
1302      *
1303      * <pre>
1304      * A raw PKIX SubjectPublicKeyInfo format public key.
1305      * NOTE: `id` may be explicitly provided by the caller when using this
1306      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1307      * blank, a default one will be computed based on the digest of the DER
1308      * encoding of the public key.
1309      * </pre>
1310      *
1311      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1312      *
1313      * @return The pkixPublicKey.
1314      */
1315     @java.lang.Override
getPkixPublicKey()1316     public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getPkixPublicKey() {
1317       if (pkixPublicKeyBuilder_ == null) {
1318         if (publicKeyCase_ == 5) {
1319           return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_;
1320         }
1321         return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance();
1322       } else {
1323         if (publicKeyCase_ == 5) {
1324           return pkixPublicKeyBuilder_.getMessage();
1325         }
1326         return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance();
1327       }
1328     }
1329     /**
1330      *
1331      *
1332      * <pre>
1333      * A raw PKIX SubjectPublicKeyInfo format public key.
1334      * NOTE: `id` may be explicitly provided by the caller when using this
1335      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1336      * blank, a default one will be computed based on the digest of the DER
1337      * encoding of the public key.
1338      * </pre>
1339      *
1340      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1341      */
setPkixPublicKey( com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey value)1342     public Builder setPkixPublicKey(
1343         com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey value) {
1344       if (pkixPublicKeyBuilder_ == null) {
1345         if (value == null) {
1346           throw new NullPointerException();
1347         }
1348         publicKey_ = value;
1349         onChanged();
1350       } else {
1351         pkixPublicKeyBuilder_.setMessage(value);
1352       }
1353       publicKeyCase_ = 5;
1354       return this;
1355     }
1356     /**
1357      *
1358      *
1359      * <pre>
1360      * A raw PKIX SubjectPublicKeyInfo format public key.
1361      * NOTE: `id` may be explicitly provided by the caller when using this
1362      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1363      * blank, a default one will be computed based on the digest of the DER
1364      * encoding of the public key.
1365      * </pre>
1366      *
1367      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1368      */
setPkixPublicKey( com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder builderForValue)1369     public Builder setPkixPublicKey(
1370         com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder builderForValue) {
1371       if (pkixPublicKeyBuilder_ == null) {
1372         publicKey_ = builderForValue.build();
1373         onChanged();
1374       } else {
1375         pkixPublicKeyBuilder_.setMessage(builderForValue.build());
1376       }
1377       publicKeyCase_ = 5;
1378       return this;
1379     }
1380     /**
1381      *
1382      *
1383      * <pre>
1384      * A raw PKIX SubjectPublicKeyInfo format public key.
1385      * NOTE: `id` may be explicitly provided by the caller when using this
1386      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1387      * blank, a default one will be computed based on the digest of the DER
1388      * encoding of the public key.
1389      * </pre>
1390      *
1391      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1392      */
mergePkixPublicKey( com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey value)1393     public Builder mergePkixPublicKey(
1394         com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey value) {
1395       if (pkixPublicKeyBuilder_ == null) {
1396         if (publicKeyCase_ == 5
1397             && publicKey_
1398                 != com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey
1399                     .getDefaultInstance()) {
1400           publicKey_ =
1401               com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.newBuilder(
1402                       (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_)
1403                   .mergeFrom(value)
1404                   .buildPartial();
1405         } else {
1406           publicKey_ = value;
1407         }
1408         onChanged();
1409       } else {
1410         if (publicKeyCase_ == 5) {
1411           pkixPublicKeyBuilder_.mergeFrom(value);
1412         } else {
1413           pkixPublicKeyBuilder_.setMessage(value);
1414         }
1415       }
1416       publicKeyCase_ = 5;
1417       return this;
1418     }
1419     /**
1420      *
1421      *
1422      * <pre>
1423      * A raw PKIX SubjectPublicKeyInfo format public key.
1424      * NOTE: `id` may be explicitly provided by the caller when using this
1425      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1426      * blank, a default one will be computed based on the digest of the DER
1427      * encoding of the public key.
1428      * </pre>
1429      *
1430      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1431      */
clearPkixPublicKey()1432     public Builder clearPkixPublicKey() {
1433       if (pkixPublicKeyBuilder_ == null) {
1434         if (publicKeyCase_ == 5) {
1435           publicKeyCase_ = 0;
1436           publicKey_ = null;
1437           onChanged();
1438         }
1439       } else {
1440         if (publicKeyCase_ == 5) {
1441           publicKeyCase_ = 0;
1442           publicKey_ = null;
1443         }
1444         pkixPublicKeyBuilder_.clear();
1445       }
1446       return this;
1447     }
1448     /**
1449      *
1450      *
1451      * <pre>
1452      * A raw PKIX SubjectPublicKeyInfo format public key.
1453      * NOTE: `id` may be explicitly provided by the caller when using this
1454      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1455      * blank, a default one will be computed based on the digest of the DER
1456      * encoding of the public key.
1457      * </pre>
1458      *
1459      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1460      */
1461     public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder
getPkixPublicKeyBuilder()1462         getPkixPublicKeyBuilder() {
1463       return getPkixPublicKeyFieldBuilder().getBuilder();
1464     }
1465     /**
1466      *
1467      *
1468      * <pre>
1469      * A raw PKIX SubjectPublicKeyInfo format public key.
1470      * NOTE: `id` may be explicitly provided by the caller when using this
1471      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1472      * blank, a default one will be computed based on the digest of the DER
1473      * encoding of the public key.
1474      * </pre>
1475      *
1476      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1477      */
1478     @java.lang.Override
1479     public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder
getPkixPublicKeyOrBuilder()1480         getPkixPublicKeyOrBuilder() {
1481       if ((publicKeyCase_ == 5) && (pkixPublicKeyBuilder_ != null)) {
1482         return pkixPublicKeyBuilder_.getMessageOrBuilder();
1483       } else {
1484         if (publicKeyCase_ == 5) {
1485           return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_;
1486         }
1487         return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance();
1488       }
1489     }
1490     /**
1491      *
1492      *
1493      * <pre>
1494      * A raw PKIX SubjectPublicKeyInfo format public key.
1495      * NOTE: `id` may be explicitly provided by the caller when using this
1496      * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
1497      * blank, a default one will be computed based on the digest of the DER
1498      * encoding of the public key.
1499      * </pre>
1500      *
1501      * <code>.google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5;</code>
1502      */
1503     private com.google.protobuf.SingleFieldBuilderV3<
1504             com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey,
1505             com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder,
1506             com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder>
getPkixPublicKeyFieldBuilder()1507         getPkixPublicKeyFieldBuilder() {
1508       if (pkixPublicKeyBuilder_ == null) {
1509         if (!(publicKeyCase_ == 5)) {
1510           publicKey_ =
1511               com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance();
1512         }
1513         pkixPublicKeyBuilder_ =
1514             new com.google.protobuf.SingleFieldBuilderV3<
1515                 com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey,
1516                 com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder,
1517                 com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder>(
1518                 (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_,
1519                 getParentForChildren(),
1520                 isClean());
1521         publicKey_ = null;
1522       }
1523       publicKeyCase_ = 5;
1524       onChanged();
1525       return pkixPublicKeyBuilder_;
1526     }
1527 
1528     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1529     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1530       return super.setUnknownFields(unknownFields);
1531     }
1532 
1533     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1534     public final Builder mergeUnknownFields(
1535         final com.google.protobuf.UnknownFieldSet unknownFields) {
1536       return super.mergeUnknownFields(unknownFields);
1537     }
1538 
1539     // @@protoc_insertion_point(builder_scope:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey)
1540   }
1541 
1542   // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey)
1543   private static final com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey
1544       DEFAULT_INSTANCE;
1545 
1546   static {
1547     DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey();
1548   }
1549 
1550   public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey
getDefaultInstance()1551       getDefaultInstance() {
1552     return DEFAULT_INSTANCE;
1553   }
1554 
1555   private static final com.google.protobuf.Parser<AttestorPublicKey> PARSER =
1556       new com.google.protobuf.AbstractParser<AttestorPublicKey>() {
1557         @java.lang.Override
1558         public AttestorPublicKey parsePartialFrom(
1559             com.google.protobuf.CodedInputStream input,
1560             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1561             throws com.google.protobuf.InvalidProtocolBufferException {
1562           Builder builder = newBuilder();
1563           try {
1564             builder.mergeFrom(input, extensionRegistry);
1565           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1566             throw e.setUnfinishedMessage(builder.buildPartial());
1567           } catch (com.google.protobuf.UninitializedMessageException e) {
1568             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1569           } catch (java.io.IOException e) {
1570             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1571                 .setUnfinishedMessage(builder.buildPartial());
1572           }
1573           return builder.buildPartial();
1574         }
1575       };
1576 
parser()1577   public static com.google.protobuf.Parser<AttestorPublicKey> parser() {
1578     return PARSER;
1579   }
1580 
1581   @java.lang.Override
getParserForType()1582   public com.google.protobuf.Parser<AttestorPublicKey> getParserForType() {
1583     return PARSER;
1584   }
1585 
1586   @java.lang.Override
1587   public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey
getDefaultInstanceForType()1588       getDefaultInstanceForType() {
1589     return DEFAULT_INSTANCE;
1590   }
1591 }
1592