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

io.opencannabis.schema.crypto.EncryptedContainer 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/Container.proto

package io.opencannabis.schema.crypto;

/**
 * 
 * Container that carries an encrypted data payload, and maintains metadata describing it.
 * 
* * Protobuf type {@code opencannabis.crypto.EncryptedContainer} */ public final class EncryptedContainer extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:opencannabis.crypto.EncryptedContainer) EncryptedContainerOrBuilder { private static final long serialVersionUID = 0L; // Use EncryptedContainer.newBuilder() to construct. private EncryptedContainer(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private EncryptedContainer() { keying_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private EncryptedContainer( 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.EncryptedData.Builder subBuilder = null; if (payload_ != null) { subBuilder = payload_.toBuilder(); } payload_ = input.readMessage(io.opencannabis.schema.crypto.EncryptedData.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(payload_); payload_ = subBuilder.buildPartial(); } break; } case 16: { int rawValue = input.readEnum(); keying_ = rawValue; break; } case 26: { io.opencannabis.schema.crypto.primitives.InitializationVector.Builder subBuilder = null; if (vector_ != null) { subBuilder = vector_.toBuilder(); } vector_ = input.readMessage(io.opencannabis.schema.crypto.primitives.InitializationVector.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(vector_); vector_ = subBuilder.buildPartial(); } break; } case 34: { io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.Builder subBuilder = null; if (parametersCase_ == 4) { subBuilder = ((io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_).toBuilder(); } parameters_ = input.readMessage(io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_); parameters_ = subBuilder.buildPartial(); } parametersCase_ = 4; break; } case 42: { io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.Builder subBuilder = null; if (parametersCase_ == 5) { subBuilder = ((io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_).toBuilder(); } parameters_ = input.readMessage(io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_); parameters_ = subBuilder.buildPartial(); } parametersCase_ = 5; 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.Container.internal_static_opencannabis_crypto_EncryptedContainer_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.crypto.Container.internal_static_opencannabis_crypto_EncryptedContainer_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.crypto.EncryptedContainer.class, io.opencannabis.schema.crypto.EncryptedContainer.Builder.class); } private int parametersCase_ = 0; private java.lang.Object parameters_; public enum ParametersCase implements com.google.protobuf.Internal.EnumLite { KEY(4), KEYPAIR(5), PARAMETERS_NOT_SET(0); private final int value; private ParametersCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ParametersCase valueOf(int value) { return forNumber(value); } public static ParametersCase forNumber(int value) { switch (value) { case 4: return KEY; case 5: return KEYPAIR; case 0: return PARAMETERS_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public ParametersCase getParametersCase() { return ParametersCase.forNumber( parametersCase_); } public static final int PAYLOAD_FIELD_NUMBER = 1; private io.opencannabis.schema.crypto.EncryptedData payload_; /** *
   * Specifies the encrypted data payload, or, the content inside this encrypted container.
   * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public boolean hasPayload() { return payload_ != null; } /** *
   * Specifies the encrypted data payload, or, the content inside this encrypted container.
   * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public io.opencannabis.schema.crypto.EncryptedData getPayload() { return payload_ == null ? io.opencannabis.schema.crypto.EncryptedData.getDefaultInstance() : payload_; } /** *
   * Specifies the encrypted data payload, or, the content inside this encrypted container.
   * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public io.opencannabis.schema.crypto.EncryptedDataOrBuilder getPayloadOrBuilder() { return getPayload(); } public static final int KEYING_FIELD_NUMBER = 2; private int keying_; /** *
   * Type of keying used to encrypt/decrypt this payload.
   * 
* * .opencannabis.crypto.KeyType keying = 2; */ public int getKeyingValue() { return keying_; } /** *
   * Type of keying used to encrypt/decrypt this payload.
   * 
* * .opencannabis.crypto.KeyType keying = 2; */ public io.opencannabis.schema.crypto.primitives.KeyType getKeying() { @SuppressWarnings("deprecation") io.opencannabis.schema.crypto.primitives.KeyType result = io.opencannabis.schema.crypto.primitives.KeyType.valueOf(keying_); return result == null ? io.opencannabis.schema.crypto.primitives.KeyType.UNRECOGNIZED : result; } public static final int VECTOR_FIELD_NUMBER = 3; private io.opencannabis.schema.crypto.primitives.InitializationVector vector_; /** *
   * Initialization vector value for this container, if applicable according to the algorithm in use.
   * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public boolean hasVector() { return vector_ != null; } /** *
   * Initialization vector value for this container, if applicable according to the algorithm in use.
   * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public io.opencannabis.schema.crypto.primitives.InitializationVector getVector() { return vector_ == null ? io.opencannabis.schema.crypto.primitives.InitializationVector.getDefaultInstance() : vector_; } /** *
   * Initialization vector value for this container, if applicable according to the algorithm in use.
   * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public io.opencannabis.schema.crypto.primitives.InitializationVectorOrBuilder getVectorOrBuilder() { return getVector(); } public static final int KEY_FIELD_NUMBER = 4; /** *
   * Specifies information regarding the key used to encrypt this container.
   * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public boolean hasKey() { return parametersCase_ == 4; } /** *
   * Specifies information regarding the key used to encrypt this container.
   * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters getKey() { if (parametersCase_ == 4) { return (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance(); } /** *
   * Specifies information regarding the key used to encrypt this container.
   * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public io.opencannabis.schema.crypto.primitives.SymmetricKeyParametersOrBuilder getKeyOrBuilder() { if (parametersCase_ == 4) { return (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance(); } public static final int KEYPAIR_FIELD_NUMBER = 5; /** *
   * Specifies information regarding the key pair used to encrypt this container.
   * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public boolean hasKeypair() { return parametersCase_ == 5; } /** *
   * Specifies information regarding the key pair used to encrypt this container.
   * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters getKeypair() { if (parametersCase_ == 5) { return (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance(); } /** *
   * Specifies information regarding the key pair used to encrypt this container.
   * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParametersOrBuilder getKeypairOrBuilder() { if (parametersCase_ == 5) { return (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance(); } 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 (payload_ != null) { output.writeMessage(1, getPayload()); } if (keying_ != io.opencannabis.schema.crypto.primitives.KeyType.SYMMETRIC.getNumber()) { output.writeEnum(2, keying_); } if (vector_ != null) { output.writeMessage(3, getVector()); } if (parametersCase_ == 4) { output.writeMessage(4, (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_); } if (parametersCase_ == 5) { output.writeMessage(5, (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (payload_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getPayload()); } if (keying_ != io.opencannabis.schema.crypto.primitives.KeyType.SYMMETRIC.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, keying_); } if (vector_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getVector()); } if (parametersCase_ == 4) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_); } if (parametersCase_ == 5) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_); } 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.EncryptedContainer)) { return super.equals(obj); } io.opencannabis.schema.crypto.EncryptedContainer other = (io.opencannabis.schema.crypto.EncryptedContainer) obj; if (hasPayload() != other.hasPayload()) return false; if (hasPayload()) { if (!getPayload() .equals(other.getPayload())) return false; } if (keying_ != other.keying_) return false; if (hasVector() != other.hasVector()) return false; if (hasVector()) { if (!getVector() .equals(other.getVector())) return false; } if (!getParametersCase().equals(other.getParametersCase())) return false; switch (parametersCase_) { case 4: if (!getKey() .equals(other.getKey())) return false; break; case 5: if (!getKeypair() .equals(other.getKeypair())) 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 (hasPayload()) { hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayload().hashCode(); } hash = (37 * hash) + KEYING_FIELD_NUMBER; hash = (53 * hash) + keying_; if (hasVector()) { hash = (37 * hash) + VECTOR_FIELD_NUMBER; hash = (53 * hash) + getVector().hashCode(); } switch (parametersCase_) { case 4: hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); break; case 5: hash = (37 * hash) + KEYPAIR_FIELD_NUMBER; hash = (53 * hash) + getKeypair().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.opencannabis.schema.crypto.EncryptedContainer parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.crypto.EncryptedContainer 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.EncryptedContainer parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.crypto.EncryptedContainer 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.EncryptedContainer parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.crypto.EncryptedContainer parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.opencannabis.schema.crypto.EncryptedContainer parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.opencannabis.schema.crypto.EncryptedContainer 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.EncryptedContainer parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.opencannabis.schema.crypto.EncryptedContainer 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.EncryptedContainer parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.opencannabis.schema.crypto.EncryptedContainer 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.EncryptedContainer 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; } /** *
   * Container that carries an encrypted data payload, and maintains metadata describing it.
   * 
* * Protobuf type {@code opencannabis.crypto.EncryptedContainer} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:opencannabis.crypto.EncryptedContainer) io.opencannabis.schema.crypto.EncryptedContainerOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencannabis.schema.crypto.Container.internal_static_opencannabis_crypto_EncryptedContainer_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.crypto.Container.internal_static_opencannabis_crypto_EncryptedContainer_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.crypto.EncryptedContainer.class, io.opencannabis.schema.crypto.EncryptedContainer.Builder.class); } // Construct using io.opencannabis.schema.crypto.EncryptedContainer.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 (payloadBuilder_ == null) { payload_ = null; } else { payload_ = null; payloadBuilder_ = null; } keying_ = 0; if (vectorBuilder_ == null) { vector_ = null; } else { vector_ = null; vectorBuilder_ = null; } parametersCase_ = 0; parameters_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.opencannabis.schema.crypto.Container.internal_static_opencannabis_crypto_EncryptedContainer_descriptor; } @java.lang.Override public io.opencannabis.schema.crypto.EncryptedContainer getDefaultInstanceForType() { return io.opencannabis.schema.crypto.EncryptedContainer.getDefaultInstance(); } @java.lang.Override public io.opencannabis.schema.crypto.EncryptedContainer build() { io.opencannabis.schema.crypto.EncryptedContainer result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.opencannabis.schema.crypto.EncryptedContainer buildPartial() { io.opencannabis.schema.crypto.EncryptedContainer result = new io.opencannabis.schema.crypto.EncryptedContainer(this); if (payloadBuilder_ == null) { result.payload_ = payload_; } else { result.payload_ = payloadBuilder_.build(); } result.keying_ = keying_; if (vectorBuilder_ == null) { result.vector_ = vector_; } else { result.vector_ = vectorBuilder_.build(); } if (parametersCase_ == 4) { if (keyBuilder_ == null) { result.parameters_ = parameters_; } else { result.parameters_ = keyBuilder_.build(); } } if (parametersCase_ == 5) { if (keypairBuilder_ == null) { result.parameters_ = parameters_; } else { result.parameters_ = keypairBuilder_.build(); } } result.parametersCase_ = parametersCase_; 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.EncryptedContainer) { return mergeFrom((io.opencannabis.schema.crypto.EncryptedContainer)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.opencannabis.schema.crypto.EncryptedContainer other) { if (other == io.opencannabis.schema.crypto.EncryptedContainer.getDefaultInstance()) return this; if (other.hasPayload()) { mergePayload(other.getPayload()); } if (other.keying_ != 0) { setKeyingValue(other.getKeyingValue()); } if (other.hasVector()) { mergeVector(other.getVector()); } switch (other.getParametersCase()) { case KEY: { mergeKey(other.getKey()); break; } case KEYPAIR: { mergeKeypair(other.getKeypair()); break; } case PARAMETERS_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.EncryptedContainer parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.opencannabis.schema.crypto.EncryptedContainer) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int parametersCase_ = 0; private java.lang.Object parameters_; public ParametersCase getParametersCase() { return ParametersCase.forNumber( parametersCase_); } public Builder clearParameters() { parametersCase_ = 0; parameters_ = null; onChanged(); return this; } private io.opencannabis.schema.crypto.EncryptedData payload_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.EncryptedData, io.opencannabis.schema.crypto.EncryptedData.Builder, io.opencannabis.schema.crypto.EncryptedDataOrBuilder> payloadBuilder_; /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public boolean hasPayload() { return payloadBuilder_ != null || payload_ != null; } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public io.opencannabis.schema.crypto.EncryptedData getPayload() { if (payloadBuilder_ == null) { return payload_ == null ? io.opencannabis.schema.crypto.EncryptedData.getDefaultInstance() : payload_; } else { return payloadBuilder_.getMessage(); } } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public Builder setPayload(io.opencannabis.schema.crypto.EncryptedData value) { if (payloadBuilder_ == null) { if (value == null) { throw new NullPointerException(); } payload_ = value; onChanged(); } else { payloadBuilder_.setMessage(value); } return this; } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public Builder setPayload( io.opencannabis.schema.crypto.EncryptedData.Builder builderForValue) { if (payloadBuilder_ == null) { payload_ = builderForValue.build(); onChanged(); } else { payloadBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public Builder mergePayload(io.opencannabis.schema.crypto.EncryptedData value) { if (payloadBuilder_ == null) { if (payload_ != null) { payload_ = io.opencannabis.schema.crypto.EncryptedData.newBuilder(payload_).mergeFrom(value).buildPartial(); } else { payload_ = value; } onChanged(); } else { payloadBuilder_.mergeFrom(value); } return this; } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public Builder clearPayload() { if (payloadBuilder_ == null) { payload_ = null; onChanged(); } else { payload_ = null; payloadBuilder_ = null; } return this; } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public io.opencannabis.schema.crypto.EncryptedData.Builder getPayloadBuilder() { onChanged(); return getPayloadFieldBuilder().getBuilder(); } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ public io.opencannabis.schema.crypto.EncryptedDataOrBuilder getPayloadOrBuilder() { if (payloadBuilder_ != null) { return payloadBuilder_.getMessageOrBuilder(); } else { return payload_ == null ? io.opencannabis.schema.crypto.EncryptedData.getDefaultInstance() : payload_; } } /** *
     * Specifies the encrypted data payload, or, the content inside this encrypted container.
     * 
* * .opencannabis.crypto.EncryptedData payload = 1; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.EncryptedData, io.opencannabis.schema.crypto.EncryptedData.Builder, io.opencannabis.schema.crypto.EncryptedDataOrBuilder> getPayloadFieldBuilder() { if (payloadBuilder_ == null) { payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.EncryptedData, io.opencannabis.schema.crypto.EncryptedData.Builder, io.opencannabis.schema.crypto.EncryptedDataOrBuilder>( getPayload(), getParentForChildren(), isClean()); payload_ = null; } return payloadBuilder_; } private int keying_ = 0; /** *
     * Type of keying used to encrypt/decrypt this payload.
     * 
* * .opencannabis.crypto.KeyType keying = 2; */ public int getKeyingValue() { return keying_; } /** *
     * Type of keying used to encrypt/decrypt this payload.
     * 
* * .opencannabis.crypto.KeyType keying = 2; */ public Builder setKeyingValue(int value) { keying_ = value; onChanged(); return this; } /** *
     * Type of keying used to encrypt/decrypt this payload.
     * 
* * .opencannabis.crypto.KeyType keying = 2; */ public io.opencannabis.schema.crypto.primitives.KeyType getKeying() { @SuppressWarnings("deprecation") io.opencannabis.schema.crypto.primitives.KeyType result = io.opencannabis.schema.crypto.primitives.KeyType.valueOf(keying_); return result == null ? io.opencannabis.schema.crypto.primitives.KeyType.UNRECOGNIZED : result; } /** *
     * Type of keying used to encrypt/decrypt this payload.
     * 
* * .opencannabis.crypto.KeyType keying = 2; */ public Builder setKeying(io.opencannabis.schema.crypto.primitives.KeyType value) { if (value == null) { throw new NullPointerException(); } keying_ = value.getNumber(); onChanged(); return this; } /** *
     * Type of keying used to encrypt/decrypt this payload.
     * 
* * .opencannabis.crypto.KeyType keying = 2; */ public Builder clearKeying() { keying_ = 0; onChanged(); return this; } private io.opencannabis.schema.crypto.primitives.InitializationVector vector_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.InitializationVector, io.opencannabis.schema.crypto.primitives.InitializationVector.Builder, io.opencannabis.schema.crypto.primitives.InitializationVectorOrBuilder> vectorBuilder_; /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public boolean hasVector() { return vectorBuilder_ != null || vector_ != null; } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public io.opencannabis.schema.crypto.primitives.InitializationVector getVector() { if (vectorBuilder_ == null) { return vector_ == null ? io.opencannabis.schema.crypto.primitives.InitializationVector.getDefaultInstance() : vector_; } else { return vectorBuilder_.getMessage(); } } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public Builder setVector(io.opencannabis.schema.crypto.primitives.InitializationVector value) { if (vectorBuilder_ == null) { if (value == null) { throw new NullPointerException(); } vector_ = value; onChanged(); } else { vectorBuilder_.setMessage(value); } return this; } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public Builder setVector( io.opencannabis.schema.crypto.primitives.InitializationVector.Builder builderForValue) { if (vectorBuilder_ == null) { vector_ = builderForValue.build(); onChanged(); } else { vectorBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public Builder mergeVector(io.opencannabis.schema.crypto.primitives.InitializationVector value) { if (vectorBuilder_ == null) { if (vector_ != null) { vector_ = io.opencannabis.schema.crypto.primitives.InitializationVector.newBuilder(vector_).mergeFrom(value).buildPartial(); } else { vector_ = value; } onChanged(); } else { vectorBuilder_.mergeFrom(value); } return this; } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public Builder clearVector() { if (vectorBuilder_ == null) { vector_ = null; onChanged(); } else { vector_ = null; vectorBuilder_ = null; } return this; } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public io.opencannabis.schema.crypto.primitives.InitializationVector.Builder getVectorBuilder() { onChanged(); return getVectorFieldBuilder().getBuilder(); } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ public io.opencannabis.schema.crypto.primitives.InitializationVectorOrBuilder getVectorOrBuilder() { if (vectorBuilder_ != null) { return vectorBuilder_.getMessageOrBuilder(); } else { return vector_ == null ? io.opencannabis.schema.crypto.primitives.InitializationVector.getDefaultInstance() : vector_; } } /** *
     * Initialization vector value for this container, if applicable according to the algorithm in use.
     * 
* * .opencannabis.crypto.InitializationVector vector = 3; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.InitializationVector, io.opencannabis.schema.crypto.primitives.InitializationVector.Builder, io.opencannabis.schema.crypto.primitives.InitializationVectorOrBuilder> getVectorFieldBuilder() { if (vectorBuilder_ == null) { vectorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.InitializationVector, io.opencannabis.schema.crypto.primitives.InitializationVector.Builder, io.opencannabis.schema.crypto.primitives.InitializationVectorOrBuilder>( getVector(), getParentForChildren(), isClean()); vector_ = null; } return vectorBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters, io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.Builder, io.opencannabis.schema.crypto.primitives.SymmetricKeyParametersOrBuilder> keyBuilder_; /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public boolean hasKey() { return parametersCase_ == 4; } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters getKey() { if (keyBuilder_ == null) { if (parametersCase_ == 4) { return (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance(); } else { if (parametersCase_ == 4) { return keyBuilder_.getMessage(); } return io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance(); } } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public Builder setKey(io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters value) { if (keyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } parameters_ = value; onChanged(); } else { keyBuilder_.setMessage(value); } parametersCase_ = 4; return this; } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public Builder setKey( io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.Builder builderForValue) { if (keyBuilder_ == null) { parameters_ = builderForValue.build(); onChanged(); } else { keyBuilder_.setMessage(builderForValue.build()); } parametersCase_ = 4; return this; } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public Builder mergeKey(io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters value) { if (keyBuilder_ == null) { if (parametersCase_ == 4 && parameters_ != io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance()) { parameters_ = io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.newBuilder((io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_) .mergeFrom(value).buildPartial(); } else { parameters_ = value; } onChanged(); } else { if (parametersCase_ == 4) { keyBuilder_.mergeFrom(value); } keyBuilder_.setMessage(value); } parametersCase_ = 4; return this; } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public Builder clearKey() { if (keyBuilder_ == null) { if (parametersCase_ == 4) { parametersCase_ = 0; parameters_ = null; onChanged(); } } else { if (parametersCase_ == 4) { parametersCase_ = 0; parameters_ = null; } keyBuilder_.clear(); } return this; } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.Builder getKeyBuilder() { return getKeyFieldBuilder().getBuilder(); } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ public io.opencannabis.schema.crypto.primitives.SymmetricKeyParametersOrBuilder getKeyOrBuilder() { if ((parametersCase_ == 4) && (keyBuilder_ != null)) { return keyBuilder_.getMessageOrBuilder(); } else { if (parametersCase_ == 4) { return (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance(); } } /** *
     * Specifies information regarding the key used to encrypt this container.
     * 
* * .opencannabis.crypto.SymmetricKeyParameters key = 4; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters, io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.Builder, io.opencannabis.schema.crypto.primitives.SymmetricKeyParametersOrBuilder> getKeyFieldBuilder() { if (keyBuilder_ == null) { if (!(parametersCase_ == 4)) { parameters_ = io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.getDefaultInstance(); } keyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters, io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters.Builder, io.opencannabis.schema.crypto.primitives.SymmetricKeyParametersOrBuilder>( (io.opencannabis.schema.crypto.primitives.SymmetricKeyParameters) parameters_, getParentForChildren(), isClean()); parameters_ = null; } parametersCase_ = 4; onChanged();; return keyBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters, io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.Builder, io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParametersOrBuilder> keypairBuilder_; /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public boolean hasKeypair() { return parametersCase_ == 5; } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters getKeypair() { if (keypairBuilder_ == null) { if (parametersCase_ == 5) { return (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance(); } else { if (parametersCase_ == 5) { return keypairBuilder_.getMessage(); } return io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance(); } } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public Builder setKeypair(io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters value) { if (keypairBuilder_ == null) { if (value == null) { throw new NullPointerException(); } parameters_ = value; onChanged(); } else { keypairBuilder_.setMessage(value); } parametersCase_ = 5; return this; } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public Builder setKeypair( io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.Builder builderForValue) { if (keypairBuilder_ == null) { parameters_ = builderForValue.build(); onChanged(); } else { keypairBuilder_.setMessage(builderForValue.build()); } parametersCase_ = 5; return this; } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public Builder mergeKeypair(io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters value) { if (keypairBuilder_ == null) { if (parametersCase_ == 5 && parameters_ != io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance()) { parameters_ = io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.newBuilder((io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_) .mergeFrom(value).buildPartial(); } else { parameters_ = value; } onChanged(); } else { if (parametersCase_ == 5) { keypairBuilder_.mergeFrom(value); } keypairBuilder_.setMessage(value); } parametersCase_ = 5; return this; } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public Builder clearKeypair() { if (keypairBuilder_ == null) { if (parametersCase_ == 5) { parametersCase_ = 0; parameters_ = null; onChanged(); } } else { if (parametersCase_ == 5) { parametersCase_ = 0; parameters_ = null; } keypairBuilder_.clear(); } return this; } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.Builder getKeypairBuilder() { return getKeypairFieldBuilder().getBuilder(); } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ public io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParametersOrBuilder getKeypairOrBuilder() { if ((parametersCase_ == 5) && (keypairBuilder_ != null)) { return keypairBuilder_.getMessageOrBuilder(); } else { if (parametersCase_ == 5) { return (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_; } return io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance(); } } /** *
     * Specifies information regarding the key pair used to encrypt this container.
     * 
* * .opencannabis.crypto.AsymmetricKeypairParameters keypair = 5; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters, io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.Builder, io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParametersOrBuilder> getKeypairFieldBuilder() { if (keypairBuilder_ == null) { if (!(parametersCase_ == 5)) { parameters_ = io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.getDefaultInstance(); } keypairBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters, io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters.Builder, io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParametersOrBuilder>( (io.opencannabis.schema.crypto.primitives.AsymmetricKeypairParameters) parameters_, getParentForChildren(), isClean()); parameters_ = null; } parametersCase_ = 5; onChanged();; return keypairBuilder_; } @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.EncryptedContainer) } // @@protoc_insertion_point(class_scope:opencannabis.crypto.EncryptedContainer) private static final io.opencannabis.schema.crypto.EncryptedContainer DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.opencannabis.schema.crypto.EncryptedContainer(); } public static io.opencannabis.schema.crypto.EncryptedContainer getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public EncryptedContainer parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new EncryptedContainer(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.EncryptedContainer getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy