All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opencannabis.schema.crypto.Signature Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2019, Momentum Ideas Co.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: crypto/Signature.proto

package io.opencannabis.schema.crypto;

/**
 * 
 * Specifies the concept of a cryptographic signature, including the raw signature bytes, a fingerprint of the data that
 * was signed, and information about the public key corresponding to the private key that performed the signing.
 * 
* * Protobuf type {@code opencannabis.crypto.Signature} */ public final class Signature extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:opencannabis.crypto.Signature) SignatureOrBuilder { private static final long serialVersionUID = 0L; // Use Signature.newBuilder() to construct. private Signature(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Signature() { } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Signature( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { io.opencannabis.schema.crypto.primitives.KeyMaterial.Builder subBuilder = null; if (publicKey_ != null) { subBuilder = publicKey_.toBuilder(); } publicKey_ = input.readMessage(io.opencannabis.schema.crypto.primitives.KeyMaterial.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(publicKey_); publicKey_ = subBuilder.buildPartial(); } break; } case 18: { io.opencannabis.schema.crypto.primitives.integrity.Hash.Builder subBuilder = null; if (fingerprint_ != null) { subBuilder = fingerprint_.toBuilder(); } fingerprint_ = input.readMessage(io.opencannabis.schema.crypto.primitives.integrity.Hash.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(fingerprint_); fingerprint_ = subBuilder.buildPartial(); } break; } case 42: { signatureCase_ = 5; signature_ = input.readBytes(); break; } case 50: { java.lang.String s = input.readStringRequireUtf8(); signatureCase_ = 6; signature_ = s; break; } case 58: { java.lang.String s = input.readStringRequireUtf8(); signatureCase_ = 7; signature_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencannabis.schema.crypto.SignatureOuterClass.internal_static_opencannabis_crypto_Signature_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.crypto.SignatureOuterClass.internal_static_opencannabis_crypto_Signature_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.crypto.Signature.class, io.opencannabis.schema.crypto.Signature.Builder.class); } private int signatureCase_ = 0; private java.lang.Object signature_; public enum SignatureCase implements com.google.protobuf.Internal.EnumLite { RAW(5), B64(6), HEX(7), SIGNATURE_NOT_SET(0); private final int value; private SignatureCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static SignatureCase valueOf(int value) { return forNumber(value); } public static SignatureCase forNumber(int value) { switch (value) { case 5: return RAW; case 6: return B64; case 7: return HEX; case 0: return SIGNATURE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public SignatureCase getSignatureCase() { return SignatureCase.forNumber( signatureCase_); } public static final int PUBLIC_KEY_FIELD_NUMBER = 1; private io.opencannabis.schema.crypto.primitives.KeyMaterial publicKey_; /** *
   * Public key fingerprint, or raw content of the public key, that performed the signing operation.
   * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public boolean hasPublicKey() { return publicKey_ != null; } /** *
   * Public key fingerprint, or raw content of the public key, that performed the signing operation.
   * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public io.opencannabis.schema.crypto.primitives.KeyMaterial getPublicKey() { return publicKey_ == null ? io.opencannabis.schema.crypto.primitives.KeyMaterial.getDefaultInstance() : publicKey_; } /** *
   * Public key fingerprint, or raw content of the public key, that performed the signing operation.
   * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public io.opencannabis.schema.crypto.primitives.KeyMaterialOrBuilder getPublicKeyOrBuilder() { return getPublicKey(); } public static final int FINGERPRINT_FIELD_NUMBER = 2; private io.opencannabis.schema.crypto.primitives.integrity.Hash fingerprint_; /** *
   * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
   * the private key and recomputed via the public key.
   * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public boolean hasFingerprint() { return fingerprint_ != null; } /** *
   * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
   * the private key and recomputed via the public key.
   * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public io.opencannabis.schema.crypto.primitives.integrity.Hash getFingerprint() { return fingerprint_ == null ? io.opencannabis.schema.crypto.primitives.integrity.Hash.getDefaultInstance() : fingerprint_; } /** *
   * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
   * the private key and recomputed via the public key.
   * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public io.opencannabis.schema.crypto.primitives.integrity.HashOrBuilder getFingerprintOrBuilder() { return getFingerprint(); } public static final int RAW_FIELD_NUMBER = 5; /** *
   * Raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding to the
   * `public_key` listed in this request.
   * 
* * bytes raw = 5; */ public com.google.protobuf.ByteString getRaw() { if (signatureCase_ == 5) { return (com.google.protobuf.ByteString) signature_; } return com.google.protobuf.ByteString.EMPTY; } public static final int B64_FIELD_NUMBER = 6; /** *
   * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
   * to the `public_key` listed in this request.
   * 
* * string b64 = 6; */ public java.lang.String getB64() { java.lang.Object ref = ""; if (signatureCase_ == 6) { ref = signature_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (signatureCase_ == 6) { signature_ = s; } return s; } } /** *
   * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
   * to the `public_key` listed in this request.
   * 
* * string b64 = 6; */ public com.google.protobuf.ByteString getB64Bytes() { java.lang.Object ref = ""; if (signatureCase_ == 6) { ref = signature_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (signatureCase_ == 6) { signature_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HEX_FIELD_NUMBER = 7; /** *
   * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
   * corresponding to the `public_key` listed in the request.
   * 
* * string hex = 7; */ public java.lang.String getHex() { java.lang.Object ref = ""; if (signatureCase_ == 7) { ref = signature_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (signatureCase_ == 7) { signature_ = s; } return s; } } /** *
   * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
   * corresponding to the `public_key` listed in the request.
   * 
* * string hex = 7; */ public com.google.protobuf.ByteString getHexBytes() { java.lang.Object ref = ""; if (signatureCase_ == 7) { ref = signature_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (signatureCase_ == 7) { signature_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (publicKey_ != null) { output.writeMessage(1, getPublicKey()); } if (fingerprint_ != null) { output.writeMessage(2, getFingerprint()); } if (signatureCase_ == 5) { output.writeBytes( 5, (com.google.protobuf.ByteString) signature_); } if (signatureCase_ == 6) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, signature_); } if (signatureCase_ == 7) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, signature_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (publicKey_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getPublicKey()); } if (fingerprint_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getFingerprint()); } if (signatureCase_ == 5) { size += com.google.protobuf.CodedOutputStream .computeBytesSize( 5, (com.google.protobuf.ByteString) signature_); } if (signatureCase_ == 6) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, signature_); } if (signatureCase_ == 7) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, signature_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.opencannabis.schema.crypto.Signature)) { return super.equals(obj); } io.opencannabis.schema.crypto.Signature other = (io.opencannabis.schema.crypto.Signature) obj; if (hasPublicKey() != other.hasPublicKey()) return false; if (hasPublicKey()) { if (!getPublicKey() .equals(other.getPublicKey())) return false; } if (hasFingerprint() != other.hasFingerprint()) return false; if (hasFingerprint()) { if (!getFingerprint() .equals(other.getFingerprint())) return false; } if (!getSignatureCase().equals(other.getSignatureCase())) return false; switch (signatureCase_) { case 5: if (!getRaw() .equals(other.getRaw())) return false; break; case 6: if (!getB64() .equals(other.getB64())) return false; break; case 7: if (!getHex() .equals(other.getHex())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasPublicKey()) { hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; hash = (53 * hash) + getPublicKey().hashCode(); } if (hasFingerprint()) { hash = (37 * hash) + FINGERPRINT_FIELD_NUMBER; hash = (53 * hash) + getFingerprint().hashCode(); } switch (signatureCase_) { case 5: hash = (37 * hash) + RAW_FIELD_NUMBER; hash = (53 * hash) + getRaw().hashCode(); break; case 6: hash = (37 * hash) + B64_FIELD_NUMBER; hash = (53 * hash) + getB64().hashCode(); break; case 7: hash = (37 * hash) + HEX_FIELD_NUMBER; hash = (53 * hash) + getHex().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.opencannabis.schema.crypto.Signature parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.crypto.Signature parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.opencannabis.schema.crypto.Signature parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.crypto.Signature parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.opencannabis.schema.crypto.Signature parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.crypto.Signature parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.opencannabis.schema.crypto.Signature parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.opencannabis.schema.crypto.Signature parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static io.opencannabis.schema.crypto.Signature parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.opencannabis.schema.crypto.Signature parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.opencannabis.schema.crypto.Signature parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.opencannabis.schema.crypto.Signature parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.opencannabis.schema.crypto.Signature prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * Specifies the concept of a cryptographic signature, including the raw signature bytes, a fingerprint of the data that
   * was signed, and information about the public key corresponding to the private key that performed the signing.
   * 
* * Protobuf type {@code opencannabis.crypto.Signature} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:opencannabis.crypto.Signature) io.opencannabis.schema.crypto.SignatureOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencannabis.schema.crypto.SignatureOuterClass.internal_static_opencannabis_crypto_Signature_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.crypto.SignatureOuterClass.internal_static_opencannabis_crypto_Signature_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.crypto.Signature.class, io.opencannabis.schema.crypto.Signature.Builder.class); } // Construct using io.opencannabis.schema.crypto.Signature.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (publicKeyBuilder_ == null) { publicKey_ = null; } else { publicKey_ = null; publicKeyBuilder_ = null; } if (fingerprintBuilder_ == null) { fingerprint_ = null; } else { fingerprint_ = null; fingerprintBuilder_ = null; } signatureCase_ = 0; signature_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.opencannabis.schema.crypto.SignatureOuterClass.internal_static_opencannabis_crypto_Signature_descriptor; } @java.lang.Override public io.opencannabis.schema.crypto.Signature getDefaultInstanceForType() { return io.opencannabis.schema.crypto.Signature.getDefaultInstance(); } @java.lang.Override public io.opencannabis.schema.crypto.Signature build() { io.opencannabis.schema.crypto.Signature result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.opencannabis.schema.crypto.Signature buildPartial() { io.opencannabis.schema.crypto.Signature result = new io.opencannabis.schema.crypto.Signature(this); if (publicKeyBuilder_ == null) { result.publicKey_ = publicKey_; } else { result.publicKey_ = publicKeyBuilder_.build(); } if (fingerprintBuilder_ == null) { result.fingerprint_ = fingerprint_; } else { result.fingerprint_ = fingerprintBuilder_.build(); } if (signatureCase_ == 5) { result.signature_ = signature_; } if (signatureCase_ == 6) { result.signature_ = signature_; } if (signatureCase_ == 7) { result.signature_ = signature_; } result.signatureCase_ = signatureCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.opencannabis.schema.crypto.Signature) { return mergeFrom((io.opencannabis.schema.crypto.Signature)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.opencannabis.schema.crypto.Signature other) { if (other == io.opencannabis.schema.crypto.Signature.getDefaultInstance()) return this; if (other.hasPublicKey()) { mergePublicKey(other.getPublicKey()); } if (other.hasFingerprint()) { mergeFingerprint(other.getFingerprint()); } switch (other.getSignatureCase()) { case RAW: { setRaw(other.getRaw()); break; } case B64: { signatureCase_ = 6; signature_ = other.signature_; onChanged(); break; } case HEX: { signatureCase_ = 7; signature_ = other.signature_; onChanged(); break; } case SIGNATURE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { io.opencannabis.schema.crypto.Signature parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.opencannabis.schema.crypto.Signature) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int signatureCase_ = 0; private java.lang.Object signature_; public SignatureCase getSignatureCase() { return SignatureCase.forNumber( signatureCase_); } public Builder clearSignature() { signatureCase_ = 0; signature_ = null; onChanged(); return this; } private io.opencannabis.schema.crypto.primitives.KeyMaterial publicKey_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.KeyMaterial, io.opencannabis.schema.crypto.primitives.KeyMaterial.Builder, io.opencannabis.schema.crypto.primitives.KeyMaterialOrBuilder> publicKeyBuilder_; /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public boolean hasPublicKey() { return publicKeyBuilder_ != null || publicKey_ != null; } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public io.opencannabis.schema.crypto.primitives.KeyMaterial getPublicKey() { if (publicKeyBuilder_ == null) { return publicKey_ == null ? io.opencannabis.schema.crypto.primitives.KeyMaterial.getDefaultInstance() : publicKey_; } else { return publicKeyBuilder_.getMessage(); } } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public Builder setPublicKey(io.opencannabis.schema.crypto.primitives.KeyMaterial value) { if (publicKeyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } publicKey_ = value; onChanged(); } else { publicKeyBuilder_.setMessage(value); } return this; } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public Builder setPublicKey( io.opencannabis.schema.crypto.primitives.KeyMaterial.Builder builderForValue) { if (publicKeyBuilder_ == null) { publicKey_ = builderForValue.build(); onChanged(); } else { publicKeyBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public Builder mergePublicKey(io.opencannabis.schema.crypto.primitives.KeyMaterial value) { if (publicKeyBuilder_ == null) { if (publicKey_ != null) { publicKey_ = io.opencannabis.schema.crypto.primitives.KeyMaterial.newBuilder(publicKey_).mergeFrom(value).buildPartial(); } else { publicKey_ = value; } onChanged(); } else { publicKeyBuilder_.mergeFrom(value); } return this; } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public Builder clearPublicKey() { if (publicKeyBuilder_ == null) { publicKey_ = null; onChanged(); } else { publicKey_ = null; publicKeyBuilder_ = null; } return this; } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public io.opencannabis.schema.crypto.primitives.KeyMaterial.Builder getPublicKeyBuilder() { onChanged(); return getPublicKeyFieldBuilder().getBuilder(); } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ public io.opencannabis.schema.crypto.primitives.KeyMaterialOrBuilder getPublicKeyOrBuilder() { if (publicKeyBuilder_ != null) { return publicKeyBuilder_.getMessageOrBuilder(); } else { return publicKey_ == null ? io.opencannabis.schema.crypto.primitives.KeyMaterial.getDefaultInstance() : publicKey_; } } /** *
     * Public key fingerprint, or raw content of the public key, that performed the signing operation.
     * 
* * .opencannabis.crypto.KeyMaterial public_key = 1; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.KeyMaterial, io.opencannabis.schema.crypto.primitives.KeyMaterial.Builder, io.opencannabis.schema.crypto.primitives.KeyMaterialOrBuilder> getPublicKeyFieldBuilder() { if (publicKeyBuilder_ == null) { publicKeyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.KeyMaterial, io.opencannabis.schema.crypto.primitives.KeyMaterial.Builder, io.opencannabis.schema.crypto.primitives.KeyMaterialOrBuilder>( getPublicKey(), getParentForChildren(), isClean()); publicKey_ = null; } return publicKeyBuilder_; } private io.opencannabis.schema.crypto.primitives.integrity.Hash fingerprint_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.integrity.Hash, io.opencannabis.schema.crypto.primitives.integrity.Hash.Builder, io.opencannabis.schema.crypto.primitives.integrity.HashOrBuilder> fingerprintBuilder_; /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public boolean hasFingerprint() { return fingerprintBuilder_ != null || fingerprint_ != null; } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public io.opencannabis.schema.crypto.primitives.integrity.Hash getFingerprint() { if (fingerprintBuilder_ == null) { return fingerprint_ == null ? io.opencannabis.schema.crypto.primitives.integrity.Hash.getDefaultInstance() : fingerprint_; } else { return fingerprintBuilder_.getMessage(); } } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public Builder setFingerprint(io.opencannabis.schema.crypto.primitives.integrity.Hash value) { if (fingerprintBuilder_ == null) { if (value == null) { throw new NullPointerException(); } fingerprint_ = value; onChanged(); } else { fingerprintBuilder_.setMessage(value); } return this; } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public Builder setFingerprint( io.opencannabis.schema.crypto.primitives.integrity.Hash.Builder builderForValue) { if (fingerprintBuilder_ == null) { fingerprint_ = builderForValue.build(); onChanged(); } else { fingerprintBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public Builder mergeFingerprint(io.opencannabis.schema.crypto.primitives.integrity.Hash value) { if (fingerprintBuilder_ == null) { if (fingerprint_ != null) { fingerprint_ = io.opencannabis.schema.crypto.primitives.integrity.Hash.newBuilder(fingerprint_).mergeFrom(value).buildPartial(); } else { fingerprint_ = value; } onChanged(); } else { fingerprintBuilder_.mergeFrom(value); } return this; } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public Builder clearFingerprint() { if (fingerprintBuilder_ == null) { fingerprint_ = null; onChanged(); } else { fingerprint_ = null; fingerprintBuilder_ = null; } return this; } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public io.opencannabis.schema.crypto.primitives.integrity.Hash.Builder getFingerprintBuilder() { onChanged(); return getFingerprintFieldBuilder().getBuilder(); } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ public io.opencannabis.schema.crypto.primitives.integrity.HashOrBuilder getFingerprintOrBuilder() { if (fingerprintBuilder_ != null) { return fingerprintBuilder_.getMessageOrBuilder(); } else { return fingerprint_ == null ? io.opencannabis.schema.crypto.primitives.integrity.Hash.getDefaultInstance() : fingerprint_; } } /** *
     * Cryptographic fingerprint of the subject data that was signed. This is the actual value that should be signed by
     * the private key and recomputed via the public key.
     * 
* * .opencannabis.crypto.Hash fingerprint = 2; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.integrity.Hash, io.opencannabis.schema.crypto.primitives.integrity.Hash.Builder, io.opencannabis.schema.crypto.primitives.integrity.HashOrBuilder> getFingerprintFieldBuilder() { if (fingerprintBuilder_ == null) { fingerprintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.integrity.Hash, io.opencannabis.schema.crypto.primitives.integrity.Hash.Builder, io.opencannabis.schema.crypto.primitives.integrity.HashOrBuilder>( getFingerprint(), getParentForChildren(), isClean()); fingerprint_ = null; } return fingerprintBuilder_; } /** *
     * Raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding to the
     * `public_key` listed in this request.
     * 
* * bytes raw = 5; */ public com.google.protobuf.ByteString getRaw() { if (signatureCase_ == 5) { return (com.google.protobuf.ByteString) signature_; } return com.google.protobuf.ByteString.EMPTY; } /** *
     * Raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding to the
     * `public_key` listed in this request.
     * 
* * bytes raw = 5; */ public Builder setRaw(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } signatureCase_ = 5; signature_ = value; onChanged(); return this; } /** *
     * Raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding to the
     * `public_key` listed in this request.
     * 
* * bytes raw = 5; */ public Builder clearRaw() { if (signatureCase_ == 5) { signatureCase_ = 0; signature_ = null; onChanged(); } return this; } /** *
     * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
     * to the `public_key` listed in this request.
     * 
* * string b64 = 6; */ public java.lang.String getB64() { java.lang.Object ref = ""; if (signatureCase_ == 6) { ref = signature_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (signatureCase_ == 6) { signature_ = s; } return s; } else { return (java.lang.String) ref; } } /** *
     * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
     * to the `public_key` listed in this request.
     * 
* * string b64 = 6; */ public com.google.protobuf.ByteString getB64Bytes() { java.lang.Object ref = ""; if (signatureCase_ == 6) { ref = signature_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (signatureCase_ == 6) { signature_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** *
     * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
     * to the `public_key` listed in this request.
     * 
* * string b64 = 6; */ public Builder setB64( java.lang.String value) { if (value == null) { throw new NullPointerException(); } signatureCase_ = 6; signature_ = value; onChanged(); return this; } /** *
     * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
     * to the `public_key` listed in this request.
     * 
* * string b64 = 6; */ public Builder clearB64() { if (signatureCase_ == 6) { signatureCase_ = 0; signature_ = null; onChanged(); } return this; } /** *
     * Base-64 encoded raw bytes of the digital signature, performed over `fingerprint` by the private key corresponding
     * to the `public_key` listed in this request.
     * 
* * string b64 = 6; */ public Builder setB64Bytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); signatureCase_ = 6; signature_ = value; onChanged(); return this; } /** *
     * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
     * corresponding to the `public_key` listed in the request.
     * 
* * string hex = 7; */ public java.lang.String getHex() { java.lang.Object ref = ""; if (signatureCase_ == 7) { ref = signature_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (signatureCase_ == 7) { signature_ = s; } return s; } else { return (java.lang.String) ref; } } /** *
     * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
     * corresponding to the `public_key` listed in the request.
     * 
* * string hex = 7; */ public com.google.protobuf.ByteString getHexBytes() { java.lang.Object ref = ""; if (signatureCase_ == 7) { ref = signature_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (signatureCase_ == 7) { signature_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** *
     * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
     * corresponding to the `public_key` listed in the request.
     * 
* * string hex = 7; */ public Builder setHex( java.lang.String value) { if (value == null) { throw new NullPointerException(); } signatureCase_ = 7; signature_ = value; onChanged(); return this; } /** *
     * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
     * corresponding to the `public_key` listed in the request.
     * 
* * string hex = 7; */ public Builder clearHex() { if (signatureCase_ == 7) { signatureCase_ = 0; signature_ = null; onChanged(); } return this; } /** *
     * Hex-encoded and uppercased raw bytes of the digital signature, performed over `fingerprint` by the private key
     * corresponding to the `public_key` listed in the request.
     * 
* * string hex = 7; */ public Builder setHexBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); signatureCase_ = 7; signature_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:opencannabis.crypto.Signature) } // @@protoc_insertion_point(class_scope:opencannabis.crypto.Signature) private static final io.opencannabis.schema.crypto.Signature DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.opencannabis.schema.crypto.Signature(); } public static io.opencannabis.schema.crypto.Signature getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Signature parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Signature(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public io.opencannabis.schema.crypto.Signature getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy