• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 The Grafeas Authors. All rights reserved.
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 
17 // Generated by the protocol buffer compiler.  DO NOT EDIT!
18 // source: grafeas/v1/common.proto
19 
20 package io.grafeas.v1;
21 
22 /**
23  *
24  *
25  * <pre>
26  * Verifiers (e.g. Kritis implementations) MUST verify signatures
27  * with respect to the trust anchors defined in policy (e.g. a Kritis policy).
28  * Typically this means that the verifier has been configured with a map from
29  * `public_key_id` to public key material (and any required parameters, e.g.
30  * signing algorithm).
31  * In particular, verification implementations MUST NOT treat the signature
32  * `public_key_id` as anything more than a key lookup hint. The `public_key_id`
33  * DOES NOT validate or authenticate a public key; it only provides a mechanism
34  * for quickly selecting a public key ALREADY CONFIGURED on the verifier through
35  * a trusted channel. Verification implementations MUST reject signatures in any
36  * of the following circumstances:
37  *   * The `public_key_id` is not recognized by the verifier.
38  *   * The public key that `public_key_id` refers to does not verify the
39  *     signature with respect to the payload.
40  * The `signature` contents SHOULD NOT be "attached" (where the payload is
41  * included with the serialized `signature` bytes). Verifiers MUST ignore any
42  * "attached" payload and only verify signatures with respect to explicitly
43  * provided payload (e.g. a `payload` field on the proto message that holds
44  * this Signature, or the canonical serialization of the proto message that
45  * holds this signature).
46  * </pre>
47  *
48  * Protobuf type {@code grafeas.v1.Signature}
49  */
50 public final class Signature extends com.google.protobuf.GeneratedMessageV3
51     implements
52     // @@protoc_insertion_point(message_implements:grafeas.v1.Signature)
53     SignatureOrBuilder {
54   private static final long serialVersionUID = 0L;
55   // Use Signature.newBuilder() to construct.
Signature(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)56   private Signature(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
57     super(builder);
58   }
59 
Signature()60   private Signature() {
61     signature_ = com.google.protobuf.ByteString.EMPTY;
62     publicKeyId_ = "";
63   }
64 
65   @java.lang.Override
66   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)67   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
68     return new Signature();
69   }
70 
71   @java.lang.Override
getUnknownFields()72   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
73     return this.unknownFields;
74   }
75 
getDescriptor()76   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
77     return io.grafeas.v1.Common.internal_static_grafeas_v1_Signature_descriptor;
78   }
79 
80   @java.lang.Override
81   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()82       internalGetFieldAccessorTable() {
83     return io.grafeas.v1.Common.internal_static_grafeas_v1_Signature_fieldAccessorTable
84         .ensureFieldAccessorsInitialized(
85             io.grafeas.v1.Signature.class, io.grafeas.v1.Signature.Builder.class);
86   }
87 
88   public static final int SIGNATURE_FIELD_NUMBER = 1;
89   private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY;
90   /**
91    *
92    *
93    * <pre>
94    * The content of the signature, an opaque bytestring.
95    * The payload that this signature verifies MUST be unambiguously provided
96    * with the Signature during verification. A wrapper message might provide
97    * the payload explicitly. Alternatively, a message might have a canonical
98    * serialization that can always be unambiguously computed to derive the
99    * payload.
100    * </pre>
101    *
102    * <code>bytes signature = 1;</code>
103    *
104    * @return The signature.
105    */
106   @java.lang.Override
getSignature()107   public com.google.protobuf.ByteString getSignature() {
108     return signature_;
109   }
110 
111   public static final int PUBLIC_KEY_ID_FIELD_NUMBER = 2;
112 
113   @SuppressWarnings("serial")
114   private volatile java.lang.Object publicKeyId_ = "";
115   /**
116    *
117    *
118    * <pre>
119    * The identifier for the public key that verifies this signature.
120    *   * The `public_key_id` is required.
121    *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
122    *   * When possible, the `public_key_id` SHOULD be an immutable reference,
123    *     such as a cryptographic digest.
124    * Examples of valid `public_key_id`s:
125    * OpenPGP V4 public key fingerprint:
126    *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
127    * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
128    * details on this scheme.
129    * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
130    * serialization):
131    *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
132    *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
133    * </pre>
134    *
135    * <code>string public_key_id = 2;</code>
136    *
137    * @return The publicKeyId.
138    */
139   @java.lang.Override
getPublicKeyId()140   public java.lang.String getPublicKeyId() {
141     java.lang.Object ref = publicKeyId_;
142     if (ref instanceof java.lang.String) {
143       return (java.lang.String) ref;
144     } else {
145       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
146       java.lang.String s = bs.toStringUtf8();
147       publicKeyId_ = s;
148       return s;
149     }
150   }
151   /**
152    *
153    *
154    * <pre>
155    * The identifier for the public key that verifies this signature.
156    *   * The `public_key_id` is required.
157    *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
158    *   * When possible, the `public_key_id` SHOULD be an immutable reference,
159    *     such as a cryptographic digest.
160    * Examples of valid `public_key_id`s:
161    * OpenPGP V4 public key fingerprint:
162    *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
163    * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
164    * details on this scheme.
165    * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
166    * serialization):
167    *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
168    *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
169    * </pre>
170    *
171    * <code>string public_key_id = 2;</code>
172    *
173    * @return The bytes for publicKeyId.
174    */
175   @java.lang.Override
getPublicKeyIdBytes()176   public com.google.protobuf.ByteString getPublicKeyIdBytes() {
177     java.lang.Object ref = publicKeyId_;
178     if (ref instanceof java.lang.String) {
179       com.google.protobuf.ByteString b =
180           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
181       publicKeyId_ = b;
182       return b;
183     } else {
184       return (com.google.protobuf.ByteString) ref;
185     }
186   }
187 
188   private byte memoizedIsInitialized = -1;
189 
190   @java.lang.Override
isInitialized()191   public final boolean isInitialized() {
192     byte isInitialized = memoizedIsInitialized;
193     if (isInitialized == 1) return true;
194     if (isInitialized == 0) return false;
195 
196     memoizedIsInitialized = 1;
197     return true;
198   }
199 
200   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)201   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
202     if (!signature_.isEmpty()) {
203       output.writeBytes(1, signature_);
204     }
205     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKeyId_)) {
206       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, publicKeyId_);
207     }
208     getUnknownFields().writeTo(output);
209   }
210 
211   @java.lang.Override
getSerializedSize()212   public int getSerializedSize() {
213     int size = memoizedSize;
214     if (size != -1) return size;
215 
216     size = 0;
217     if (!signature_.isEmpty()) {
218       size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, signature_);
219     }
220     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKeyId_)) {
221       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, publicKeyId_);
222     }
223     size += getUnknownFields().getSerializedSize();
224     memoizedSize = size;
225     return size;
226   }
227 
228   @java.lang.Override
equals(final java.lang.Object obj)229   public boolean equals(final java.lang.Object obj) {
230     if (obj == this) {
231       return true;
232     }
233     if (!(obj instanceof io.grafeas.v1.Signature)) {
234       return super.equals(obj);
235     }
236     io.grafeas.v1.Signature other = (io.grafeas.v1.Signature) obj;
237 
238     if (!getSignature().equals(other.getSignature())) return false;
239     if (!getPublicKeyId().equals(other.getPublicKeyId())) return false;
240     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
241     return true;
242   }
243 
244   @java.lang.Override
hashCode()245   public int hashCode() {
246     if (memoizedHashCode != 0) {
247       return memoizedHashCode;
248     }
249     int hash = 41;
250     hash = (19 * hash) + getDescriptor().hashCode();
251     hash = (37 * hash) + SIGNATURE_FIELD_NUMBER;
252     hash = (53 * hash) + getSignature().hashCode();
253     hash = (37 * hash) + PUBLIC_KEY_ID_FIELD_NUMBER;
254     hash = (53 * hash) + getPublicKeyId().hashCode();
255     hash = (29 * hash) + getUnknownFields().hashCode();
256     memoizedHashCode = hash;
257     return hash;
258   }
259 
parseFrom(java.nio.ByteBuffer data)260   public static io.grafeas.v1.Signature parseFrom(java.nio.ByteBuffer data)
261       throws com.google.protobuf.InvalidProtocolBufferException {
262     return PARSER.parseFrom(data);
263   }
264 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)265   public static io.grafeas.v1.Signature parseFrom(
266       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
267       throws com.google.protobuf.InvalidProtocolBufferException {
268     return PARSER.parseFrom(data, extensionRegistry);
269   }
270 
parseFrom(com.google.protobuf.ByteString data)271   public static io.grafeas.v1.Signature parseFrom(com.google.protobuf.ByteString data)
272       throws com.google.protobuf.InvalidProtocolBufferException {
273     return PARSER.parseFrom(data);
274   }
275 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)276   public static io.grafeas.v1.Signature parseFrom(
277       com.google.protobuf.ByteString data,
278       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
279       throws com.google.protobuf.InvalidProtocolBufferException {
280     return PARSER.parseFrom(data, extensionRegistry);
281   }
282 
parseFrom(byte[] data)283   public static io.grafeas.v1.Signature parseFrom(byte[] data)
284       throws com.google.protobuf.InvalidProtocolBufferException {
285     return PARSER.parseFrom(data);
286   }
287 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)288   public static io.grafeas.v1.Signature parseFrom(
289       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
290       throws com.google.protobuf.InvalidProtocolBufferException {
291     return PARSER.parseFrom(data, extensionRegistry);
292   }
293 
parseFrom(java.io.InputStream input)294   public static io.grafeas.v1.Signature parseFrom(java.io.InputStream input)
295       throws java.io.IOException {
296     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
297   }
298 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)299   public static io.grafeas.v1.Signature parseFrom(
300       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
301       throws java.io.IOException {
302     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
303         PARSER, input, extensionRegistry);
304   }
305 
parseDelimitedFrom(java.io.InputStream input)306   public static io.grafeas.v1.Signature parseDelimitedFrom(java.io.InputStream input)
307       throws java.io.IOException {
308     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
309   }
310 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)311   public static io.grafeas.v1.Signature parseDelimitedFrom(
312       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
313       throws java.io.IOException {
314     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
315         PARSER, input, extensionRegistry);
316   }
317 
parseFrom(com.google.protobuf.CodedInputStream input)318   public static io.grafeas.v1.Signature parseFrom(com.google.protobuf.CodedInputStream input)
319       throws java.io.IOException {
320     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
321   }
322 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)323   public static io.grafeas.v1.Signature parseFrom(
324       com.google.protobuf.CodedInputStream input,
325       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
326       throws java.io.IOException {
327     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
328         PARSER, input, extensionRegistry);
329   }
330 
331   @java.lang.Override
newBuilderForType()332   public Builder newBuilderForType() {
333     return newBuilder();
334   }
335 
newBuilder()336   public static Builder newBuilder() {
337     return DEFAULT_INSTANCE.toBuilder();
338   }
339 
newBuilder(io.grafeas.v1.Signature prototype)340   public static Builder newBuilder(io.grafeas.v1.Signature prototype) {
341     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
342   }
343 
344   @java.lang.Override
toBuilder()345   public Builder toBuilder() {
346     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
347   }
348 
349   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)350   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
351     Builder builder = new Builder(parent);
352     return builder;
353   }
354   /**
355    *
356    *
357    * <pre>
358    * Verifiers (e.g. Kritis implementations) MUST verify signatures
359    * with respect to the trust anchors defined in policy (e.g. a Kritis policy).
360    * Typically this means that the verifier has been configured with a map from
361    * `public_key_id` to public key material (and any required parameters, e.g.
362    * signing algorithm).
363    * In particular, verification implementations MUST NOT treat the signature
364    * `public_key_id` as anything more than a key lookup hint. The `public_key_id`
365    * DOES NOT validate or authenticate a public key; it only provides a mechanism
366    * for quickly selecting a public key ALREADY CONFIGURED on the verifier through
367    * a trusted channel. Verification implementations MUST reject signatures in any
368    * of the following circumstances:
369    *   * The `public_key_id` is not recognized by the verifier.
370    *   * The public key that `public_key_id` refers to does not verify the
371    *     signature with respect to the payload.
372    * The `signature` contents SHOULD NOT be "attached" (where the payload is
373    * included with the serialized `signature` bytes). Verifiers MUST ignore any
374    * "attached" payload and only verify signatures with respect to explicitly
375    * provided payload (e.g. a `payload` field on the proto message that holds
376    * this Signature, or the canonical serialization of the proto message that
377    * holds this signature).
378    * </pre>
379    *
380    * Protobuf type {@code grafeas.v1.Signature}
381    */
382   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
383       implements
384       // @@protoc_insertion_point(builder_implements:grafeas.v1.Signature)
385       io.grafeas.v1.SignatureOrBuilder {
getDescriptor()386     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
387       return io.grafeas.v1.Common.internal_static_grafeas_v1_Signature_descriptor;
388     }
389 
390     @java.lang.Override
391     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()392         internalGetFieldAccessorTable() {
393       return io.grafeas.v1.Common.internal_static_grafeas_v1_Signature_fieldAccessorTable
394           .ensureFieldAccessorsInitialized(
395               io.grafeas.v1.Signature.class, io.grafeas.v1.Signature.Builder.class);
396     }
397 
398     // Construct using io.grafeas.v1.Signature.newBuilder()
Builder()399     private Builder() {}
400 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)401     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
402       super(parent);
403     }
404 
405     @java.lang.Override
clear()406     public Builder clear() {
407       super.clear();
408       bitField0_ = 0;
409       signature_ = com.google.protobuf.ByteString.EMPTY;
410       publicKeyId_ = "";
411       return this;
412     }
413 
414     @java.lang.Override
getDescriptorForType()415     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
416       return io.grafeas.v1.Common.internal_static_grafeas_v1_Signature_descriptor;
417     }
418 
419     @java.lang.Override
getDefaultInstanceForType()420     public io.grafeas.v1.Signature getDefaultInstanceForType() {
421       return io.grafeas.v1.Signature.getDefaultInstance();
422     }
423 
424     @java.lang.Override
build()425     public io.grafeas.v1.Signature build() {
426       io.grafeas.v1.Signature result = buildPartial();
427       if (!result.isInitialized()) {
428         throw newUninitializedMessageException(result);
429       }
430       return result;
431     }
432 
433     @java.lang.Override
buildPartial()434     public io.grafeas.v1.Signature buildPartial() {
435       io.grafeas.v1.Signature result = new io.grafeas.v1.Signature(this);
436       if (bitField0_ != 0) {
437         buildPartial0(result);
438       }
439       onBuilt();
440       return result;
441     }
442 
buildPartial0(io.grafeas.v1.Signature result)443     private void buildPartial0(io.grafeas.v1.Signature result) {
444       int from_bitField0_ = bitField0_;
445       if (((from_bitField0_ & 0x00000001) != 0)) {
446         result.signature_ = signature_;
447       }
448       if (((from_bitField0_ & 0x00000002) != 0)) {
449         result.publicKeyId_ = publicKeyId_;
450       }
451     }
452 
453     @java.lang.Override
clone()454     public Builder clone() {
455       return super.clone();
456     }
457 
458     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)459     public Builder setField(
460         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
461       return super.setField(field, value);
462     }
463 
464     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)465     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
466       return super.clearField(field);
467     }
468 
469     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)470     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
471       return super.clearOneof(oneof);
472     }
473 
474     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)475     public Builder setRepeatedField(
476         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
477       return super.setRepeatedField(field, index, value);
478     }
479 
480     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)481     public Builder addRepeatedField(
482         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
483       return super.addRepeatedField(field, value);
484     }
485 
486     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)487     public Builder mergeFrom(com.google.protobuf.Message other) {
488       if (other instanceof io.grafeas.v1.Signature) {
489         return mergeFrom((io.grafeas.v1.Signature) other);
490       } else {
491         super.mergeFrom(other);
492         return this;
493       }
494     }
495 
mergeFrom(io.grafeas.v1.Signature other)496     public Builder mergeFrom(io.grafeas.v1.Signature other) {
497       if (other == io.grafeas.v1.Signature.getDefaultInstance()) return this;
498       if (other.getSignature() != com.google.protobuf.ByteString.EMPTY) {
499         setSignature(other.getSignature());
500       }
501       if (!other.getPublicKeyId().isEmpty()) {
502         publicKeyId_ = other.publicKeyId_;
503         bitField0_ |= 0x00000002;
504         onChanged();
505       }
506       this.mergeUnknownFields(other.getUnknownFields());
507       onChanged();
508       return this;
509     }
510 
511     @java.lang.Override
isInitialized()512     public final boolean isInitialized() {
513       return true;
514     }
515 
516     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)517     public Builder mergeFrom(
518         com.google.protobuf.CodedInputStream input,
519         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
520         throws java.io.IOException {
521       if (extensionRegistry == null) {
522         throw new java.lang.NullPointerException();
523       }
524       try {
525         boolean done = false;
526         while (!done) {
527           int tag = input.readTag();
528           switch (tag) {
529             case 0:
530               done = true;
531               break;
532             case 10:
533               {
534                 signature_ = input.readBytes();
535                 bitField0_ |= 0x00000001;
536                 break;
537               } // case 10
538             case 18:
539               {
540                 publicKeyId_ = input.readStringRequireUtf8();
541                 bitField0_ |= 0x00000002;
542                 break;
543               } // case 18
544             default:
545               {
546                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
547                   done = true; // was an endgroup tag
548                 }
549                 break;
550               } // default:
551           } // switch (tag)
552         } // while (!done)
553       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
554         throw e.unwrapIOException();
555       } finally {
556         onChanged();
557       } // finally
558       return this;
559     }
560 
561     private int bitField0_;
562 
563     private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY;
564     /**
565      *
566      *
567      * <pre>
568      * The content of the signature, an opaque bytestring.
569      * The payload that this signature verifies MUST be unambiguously provided
570      * with the Signature during verification. A wrapper message might provide
571      * the payload explicitly. Alternatively, a message might have a canonical
572      * serialization that can always be unambiguously computed to derive the
573      * payload.
574      * </pre>
575      *
576      * <code>bytes signature = 1;</code>
577      *
578      * @return The signature.
579      */
580     @java.lang.Override
getSignature()581     public com.google.protobuf.ByteString getSignature() {
582       return signature_;
583     }
584     /**
585      *
586      *
587      * <pre>
588      * The content of the signature, an opaque bytestring.
589      * The payload that this signature verifies MUST be unambiguously provided
590      * with the Signature during verification. A wrapper message might provide
591      * the payload explicitly. Alternatively, a message might have a canonical
592      * serialization that can always be unambiguously computed to derive the
593      * payload.
594      * </pre>
595      *
596      * <code>bytes signature = 1;</code>
597      *
598      * @param value The signature to set.
599      * @return This builder for chaining.
600      */
setSignature(com.google.protobuf.ByteString value)601     public Builder setSignature(com.google.protobuf.ByteString value) {
602       if (value == null) {
603         throw new NullPointerException();
604       }
605       signature_ = value;
606       bitField0_ |= 0x00000001;
607       onChanged();
608       return this;
609     }
610     /**
611      *
612      *
613      * <pre>
614      * The content of the signature, an opaque bytestring.
615      * The payload that this signature verifies MUST be unambiguously provided
616      * with the Signature during verification. A wrapper message might provide
617      * the payload explicitly. Alternatively, a message might have a canonical
618      * serialization that can always be unambiguously computed to derive the
619      * payload.
620      * </pre>
621      *
622      * <code>bytes signature = 1;</code>
623      *
624      * @return This builder for chaining.
625      */
clearSignature()626     public Builder clearSignature() {
627       bitField0_ = (bitField0_ & ~0x00000001);
628       signature_ = getDefaultInstance().getSignature();
629       onChanged();
630       return this;
631     }
632 
633     private java.lang.Object publicKeyId_ = "";
634     /**
635      *
636      *
637      * <pre>
638      * The identifier for the public key that verifies this signature.
639      *   * The `public_key_id` is required.
640      *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
641      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
642      *     such as a cryptographic digest.
643      * Examples of valid `public_key_id`s:
644      * OpenPGP V4 public key fingerprint:
645      *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
646      * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
647      * details on this scheme.
648      * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
649      * serialization):
650      *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
651      *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
652      * </pre>
653      *
654      * <code>string public_key_id = 2;</code>
655      *
656      * @return The publicKeyId.
657      */
getPublicKeyId()658     public java.lang.String getPublicKeyId() {
659       java.lang.Object ref = publicKeyId_;
660       if (!(ref instanceof java.lang.String)) {
661         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
662         java.lang.String s = bs.toStringUtf8();
663         publicKeyId_ = s;
664         return s;
665       } else {
666         return (java.lang.String) ref;
667       }
668     }
669     /**
670      *
671      *
672      * <pre>
673      * The identifier for the public key that verifies this signature.
674      *   * The `public_key_id` is required.
675      *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
676      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
677      *     such as a cryptographic digest.
678      * Examples of valid `public_key_id`s:
679      * OpenPGP V4 public key fingerprint:
680      *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
681      * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
682      * details on this scheme.
683      * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
684      * serialization):
685      *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
686      *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
687      * </pre>
688      *
689      * <code>string public_key_id = 2;</code>
690      *
691      * @return The bytes for publicKeyId.
692      */
getPublicKeyIdBytes()693     public com.google.protobuf.ByteString getPublicKeyIdBytes() {
694       java.lang.Object ref = publicKeyId_;
695       if (ref instanceof String) {
696         com.google.protobuf.ByteString b =
697             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
698         publicKeyId_ = b;
699         return b;
700       } else {
701         return (com.google.protobuf.ByteString) ref;
702       }
703     }
704     /**
705      *
706      *
707      * <pre>
708      * The identifier for the public key that verifies this signature.
709      *   * The `public_key_id` is required.
710      *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
711      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
712      *     such as a cryptographic digest.
713      * Examples of valid `public_key_id`s:
714      * OpenPGP V4 public key fingerprint:
715      *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
716      * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
717      * details on this scheme.
718      * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
719      * serialization):
720      *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
721      *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
722      * </pre>
723      *
724      * <code>string public_key_id = 2;</code>
725      *
726      * @param value The publicKeyId to set.
727      * @return This builder for chaining.
728      */
setPublicKeyId(java.lang.String value)729     public Builder setPublicKeyId(java.lang.String value) {
730       if (value == null) {
731         throw new NullPointerException();
732       }
733       publicKeyId_ = value;
734       bitField0_ |= 0x00000002;
735       onChanged();
736       return this;
737     }
738     /**
739      *
740      *
741      * <pre>
742      * The identifier for the public key that verifies this signature.
743      *   * The `public_key_id` is required.
744      *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
745      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
746      *     such as a cryptographic digest.
747      * Examples of valid `public_key_id`s:
748      * OpenPGP V4 public key fingerprint:
749      *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
750      * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
751      * details on this scheme.
752      * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
753      * serialization):
754      *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
755      *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
756      * </pre>
757      *
758      * <code>string public_key_id = 2;</code>
759      *
760      * @return This builder for chaining.
761      */
clearPublicKeyId()762     public Builder clearPublicKeyId() {
763       publicKeyId_ = getDefaultInstance().getPublicKeyId();
764       bitField0_ = (bitField0_ & ~0x00000002);
765       onChanged();
766       return this;
767     }
768     /**
769      *
770      *
771      * <pre>
772      * The identifier for the public key that verifies this signature.
773      *   * The `public_key_id` is required.
774      *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
775      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
776      *     such as a cryptographic digest.
777      * Examples of valid `public_key_id`s:
778      * OpenPGP V4 public key fingerprint:
779      *   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
780      * See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
781      * details on this scheme.
782      * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
783      * serialization):
784      *   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
785      *   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
786      * </pre>
787      *
788      * <code>string public_key_id = 2;</code>
789      *
790      * @param value The bytes for publicKeyId to set.
791      * @return This builder for chaining.
792      */
setPublicKeyIdBytes(com.google.protobuf.ByteString value)793     public Builder setPublicKeyIdBytes(com.google.protobuf.ByteString value) {
794       if (value == null) {
795         throw new NullPointerException();
796       }
797       checkByteStringIsUtf8(value);
798       publicKeyId_ = value;
799       bitField0_ |= 0x00000002;
800       onChanged();
801       return this;
802     }
803 
804     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)805     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
806       return super.setUnknownFields(unknownFields);
807     }
808 
809     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)810     public final Builder mergeUnknownFields(
811         final com.google.protobuf.UnknownFieldSet unknownFields) {
812       return super.mergeUnknownFields(unknownFields);
813     }
814 
815     // @@protoc_insertion_point(builder_scope:grafeas.v1.Signature)
816   }
817 
818   // @@protoc_insertion_point(class_scope:grafeas.v1.Signature)
819   private static final io.grafeas.v1.Signature DEFAULT_INSTANCE;
820 
821   static {
822     DEFAULT_INSTANCE = new io.grafeas.v1.Signature();
823   }
824 
getDefaultInstance()825   public static io.grafeas.v1.Signature getDefaultInstance() {
826     return DEFAULT_INSTANCE;
827   }
828 
829   private static final com.google.protobuf.Parser<Signature> PARSER =
830       new com.google.protobuf.AbstractParser<Signature>() {
831         @java.lang.Override
832         public Signature parsePartialFrom(
833             com.google.protobuf.CodedInputStream input,
834             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
835             throws com.google.protobuf.InvalidProtocolBufferException {
836           Builder builder = newBuilder();
837           try {
838             builder.mergeFrom(input, extensionRegistry);
839           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
840             throw e.setUnfinishedMessage(builder.buildPartial());
841           } catch (com.google.protobuf.UninitializedMessageException e) {
842             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
843           } catch (java.io.IOException e) {
844             throw new com.google.protobuf.InvalidProtocolBufferException(e)
845                 .setUnfinishedMessage(builder.buildPartial());
846           }
847           return builder.buildPartial();
848         }
849       };
850 
parser()851   public static com.google.protobuf.Parser<Signature> parser() {
852     return PARSER;
853   }
854 
855   @java.lang.Override
getParserForType()856   public com.google.protobuf.Parser<Signature> getParserForType() {
857     return PARSER;
858   }
859 
860   @java.lang.Override
getDefaultInstanceForType()861   public io.grafeas.v1.Signature getDefaultInstanceForType() {
862     return DEFAULT_INSTANCE;
863   }
864 }
865